This is the mail archive of the
mailing list for the newlib project.
Re: [PATCH] Reduce code size of _REENT_INIT_PTR()
- From: Freddie Chopin <freddie_chopin at op dot pl>
- To: newlib at sourceware dot org
- Date: Fri, 26 Apr 2013 21:55:45 +0200
- Subject: Re: [PATCH] Reduce code size of _REENT_INIT_PTR()
- References: <1366965833-13948-1-git-send-email-sebastian dot huber at embedded-brains dot de> <517AD8A0 dot 4020007 at users dot sourceforge dot net>
W dniu 2013-04-26 21:42, Yaakov (Cygwin/X) pisze:
On 2013-04-26 03:43, 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.
This sounds like a candidate for PREFER_SIZE_OVER_SPEED, but AFAICS that
would mean moving that definition out of configure.host and into
I'm almost sure that memset() version will be both faster and smaller,
especially because there was a memset() call anyway... In my opinion
there is no tradeoff in this change - it's just better.