Simon South created THRIFT-2684:
-----------------------------------

             Summary: c_glib: Improvements to map deserialization in generated 
code
                 Key: THRIFT-2684
                 URL: https://issues.apache.org/jira/browse/THRIFT-2684
             Project: Thrift
          Issue Type: Improvement
          Components: C glib - Compiler
    Affects Versions: 0.9.1
         Environment: Fedora 20 64-bit on x86_64
            Reporter: Simon South
            Priority: Minor


The attached patch to the compiler improves memory management in generated code 
relating to the deserialization of maps (implemented using hash tables in 
c_glib). It makes three changes:

1. Newly created hash tables are constructed with references to the correct 
hashing, comparison and deallocation functions, as determined by the types they 
hold.

2. Base types allocated on the heap will be automatically deallocated with the 
{{g_free}} function (instead of not being deallocated at all!).

3. The direct-comparison function is now explicitly specified for enumerated 
types, which are (somewhat dubiously) always stored _within_ a pointer value 
instead of on the heap.

(No test case for these changes either, mostly as I'm unsure how I'd write one. 
Again the integration test serves as a pretty rigorous test of this code, 
though it completes with or without this patch applied.)



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to