[ 
https://issues.apache.org/jira/browse/THRIFT-1188?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Roger Meier resolved THRIFT-1188.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 0.9.2
         Assignee: Roger Meier

committed

> C++: Use bit fields for a more compact __isset struct
> -----------------------------------------------------
>
>                 Key: THRIFT-1188
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1188
>             Project: Thrift
>          Issue Type: New Feature
>          Components: C++ - Compiler
>    Affects Versions: 0.6.1, 0.7
>            Reporter: Eric Rannaud
>            Assignee: Roger Meier
>             Fix For: 0.9.2
>
>         Attachments: thrift-cpp-isset-bitfield.patch
>
>
> With the C++ generator, the __isset structure is made of bool fields.
> For Thrift objects with many optional fields, the memory impact of the 
> __isset structure with respect to the actual data payload can be significant.
> This patch simply turns each member of __isset into a 1-bit field.
> This patch does not pack the structure as I'm not sure how this should be 
> handled in general. As is, it will depend on the compiler whether there is a 
> real size gain (with GCC 4.5 the struct is packed at all optimization levels).
> To enforce packing in all cases, should I define a T_ATTRIBUTE_PACKED macro 
> in Thrift.h? That wouldn't work for compilers that use #pragma, however.



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

Reply via email to