[PATCH] Reduce code size of _REENT_INIT_PTR()

Joel Sherrill joel.sherrill@oarcorp.com
Fri Apr 26 14:45:00 GMT 2013

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

More information about the Newlib mailing list