stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Created: (STDCXX-163) ios_base data member layout wastes 2 bytes
Date Tue, 14 Mar 2006 16:05:26 GMT
ios_base data member layout wastes 2 bytes
------------------------------------------

         Key: STDCXX-163
         URL: http://issues.apache.org/jira/browse/STDCXX-163
     Project: C++ Standard Library
        Type: Improvement
  Components: 27. Input/Output  
    Versions: 4.1.3    
 Environment: all
    Reporter: Martin Sebor
    Priority: Minor


The latest HP aCC beta points out a space inefficiency in the definition of the ios_base class.
The next time we break binary compatibility we should rearrange the data mebers to avoid the
wasted space.

aCC -c -D_RWSTD_USE_CONFIG -I/build/sebor/aCC-6.07-8s/include -I/build/sebor/dev/stdlib/include
 -AA  +O2  +w +wlint +W392 +W655 +W684 +W818 +W819 +W849 +W2193 +W2236 +W2261 +W2340 +W2401
+W2487 +W4255   /build/sebor/dev/stdlib/src/iostream.cpp
"/build/sebor/dev/stdlib/include/rw/_iosbase.h", line 357: remark #4227-D: 
          padding struct with 2 bytes to align member "_C_usr"
      _C_usr_data *_C_usr;      // user data (iword, pword, callbacks)
                   ^

$ cat -n /build/sebor/dev/stdlib/include/rw/_iosbase.h | head -n 360 | tail -n 33
   328      void              *_C_rdbuf;    // pointer to the associated stream buffer
   329      _RWSTD_STREAMSIZE  _C_prec;     // current precision
   330      _RWSTD_STREAMSIZE  _C_wide;     // current width
   331      unsigned           _C_fmtfl;    // formatting flags
   332      unsigned char      _C_state;    // stream state
   333      unsigned char      _C_except;   // active exceptions
   334      
   335      static bool _C_sync_with_stdio;
   336  
   337  private:
   338  
   339      ios_base (const ios_base&);               // not defined
   340      ios_base& operator= (const ios_base&);    // not defined
   341  
   342  #if __EDG_VERSION__ < 245
   343  
   344      // working around an EDG eccp 2.3x bug (also derivatives,
   345      // such as MIPSpro, see PR #28631)
   346  public:
   347      struct _C_usr_data;
   348  
   349  #else
   350  
   351  protected:
   352      struct _C_usr_data;
   353  
   354  #endif   // EDG < 2.45
   355  
   356  protected:
   357      _C_usr_data *_C_usr;      // user data (iword, pword, callbacks)
   358      locale       _C_loc;      // locale associated with stream
   359  
   360      friend struct _RWSTD_EXPORT Init;


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message