This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Reduce code size of _REENT_INIT_PTR()


On 4/26/2013 5:29 AM, Eric Blake wrote:
On 04/26/2013 02:43 AM, Sebastian Huber wrote:
Use one memset() to initialize everything to zero.  Set non-zero fields
in a second step.  There is only a small runtime overhead, but the code
size is greatly reduced.  This change assumes the NULL pointer and '\0'
are encoded as zero bits.
'\0' is required to be all zero bits by C99; no assumption required.
NULL is allowed to be encoded as non-zero bits, but such systems are
extremely rare, and I don't know of any newlib target that violates the
assumption (that is, we have other code in newlib that assumes a memset
to 0 correctly initializes null pointer values).

Is that a blessing to commit this Eric?

--
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill@OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]