[PATCH] Reduce code size of _REENT_INIT_PTR()
Eric Blake
eblake@redhat.com
Fri Apr 26 15:10:00 GMT 2013
On 04/26/2013 08:45 AM, Joel Sherrill wrote:
> 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?
The idea makes sense, and the code looks okay to me, but I'm not a
maintainer, so you may want for additional approval.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://sourceware.org/pipermail/newlib/attachments/20130426/324ecd8f/attachment.sig>
More information about the Newlib
mailing list