1. Avro
  2. AVRO-367

Complete memory management for the C implementation


    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0
    • Component/s: c
    • Labels:


      This patch completes memory management for the C implementation.

      • All schema and datum objects are now freed when dereferenced
      • Four new methods have been added avro_wrapstring, avro_wrapbytes, avro_givestring, and avro_givebytes. These new methods allow C developers to explicitly state if they want libavro to copy bytes/string (the default), "wrap" them with no memory management or "give" them to libavro to manage. This allows for less buffer copying when decoding data.
      • Issues with type punning have been resolved to prevent compiler warnings
      • The map and record data structures now implement management correctly.
      • A new valgrind test is added and runs during make check if valgrind is found on the build system.

      A future optimization will be to have a stack of allocated objects for each obj type instead of always using malloc() and free().

      1. AVRO-367.patch
        21 kB
        Matt Massie


        Matt Massie created issue -
        Matt Massie made changes -
        Field Original Value New Value
        Assignee Matt Massie [ massie ]
        Matt Massie made changes -
        Attachment AVRO-367.patch [ 12431133 ]
        Matt Massie made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Matt Massie added a comment -

        Committed to trunk

        Matt Massie added a comment - Committed to trunk
        Matt Massie made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Doug Cutting made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Patch Available Patch Available
        44m 17s 1 Matt Massie 22/Jan/10 19:00
        Patch Available Patch Available Resolved Resolved
        3m 18s 1 Matt Massie 22/Jan/10 19:04
        Resolved Resolved Closed Closed
        37d 22h 5m 1 Doug Cutting 01/Mar/10 17:09


          • Assignee:
            Matt Massie
            Matt Massie
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: