Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-2569

Introduce Buffer abstraction to minimize inline buffer size constants, allocation and safe-guards

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      We tend to have code (mostly in libprocess) like:

        if (socket.isReady()) {
          // Inform the socket manager for proper bookkeeping.
          socket_manager->accepted(socket.get());
      
          const size_t size = 80 * 1024;
          char* data = new char[size];
          memset(data, 0, size);
      

      We can introduce a Buffer abstraction to stout which hides the pointers and helps initializing, copying, etc. This should make those buffers less error prone too.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nnielsen Niklas Quarfot Nielsen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: