[PATCH] libc/time/gmtime_r.c, libc/time/lcltime_r.c,, libc/time/local.h, libc/time/mktm_r.c: move localtime related functionality, from _mktm_r() to new _mklocaltm_r() to break dependency of gmtime() on, timezones
Jeff Johnston
jjohnstn@redhat.com
Thu Sep 11 19:51:00 GMT 2014
- Previous message (by thread): [PATCH] libc/time/gmtime_r.c, libc/time/lcltime_r.c,, libc/time/local.h, libc/time/mktm_r.c: move localtime related functionality, from _mktm_r() to new _mklocaltm_r() to break dependency of gmtime() on, timezones
- Next message (by thread): [PATCH] libc/time/gmtime_r.c, libc/time/lcltime_r.c,, libc/time/local.h, libc/time/mktm_r.c: move localtime related functionality, from _mktm_r() to new _mklocaltm_r() to break dependency of gmtime() on, timezones
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Hi Freddie,
Corinna who was looking at this previously is on vacation so I am reviewing it.
The only comments I have are:
1. month_lengths needs to be renamed to be __month_lengths because it is now externalized.
2. you might as well be consistent with other files in LIB_SOURCES list of Makefile.am with regards to tabs vs spaces.
-- Jeff J.
----- Original Message -----
> From: "Freddie Chopin" <freddie_chopin@op.pl>
> To: newlib@sourceware.org
> Sent: Tuesday, September 9, 2014 5:51:16 PM
> Subject: Re: [PATCH] libc/time/gmtime_r.c, libc/time/lcltime_r.c,, libc/time/local.h, libc/time/mktm_r.c: move
> localtime related functionality, from _mktm_r() to new _mklocaltm_r() to break dependency of gmtime() on, timezones
>
> W dniu 2014-09-06 00:19, Freddie Chopin pisze:
> > Hello!
> >
> > Modified patch (with ChangeLog entry) attached.
> >
> > This time I have gone a bit further, the summary of changes is contained
> > in the patch, but I'm pasting it here for clarity:
> >
> > libc/time: Remove dependency of gmtime() on time zone related code
> >
> > 1. Move mon_lengths array to new file, rename to month_lengths
> > 2. Move __tzcalc_limits() to new file
> > 3. Move time zone related part of _mktm_r() to localtime_r(), before
> > performing these time zone adjustments call gmtime_r()
> > 4. Move remaining part of _mktm_r() to gmtime_r()
> > 5. Remove mktm_r.c
> > 6. Modify Makefile.am and regenerate Makefile.in
> >
> > The gain when using gmtime() only is the same as previously. It is also
> > worth noting that with this change (just as with the previous version)
> > if you have BOTH gmtime() and localtime() calls in your code it will be
> > a bit bigger than before - about 150B of .text (on ARM Cortex-M3) - this
> > is because now the code is spread between two functions, with a little
> > bit of duplication of initializations, while previously it was only one
> > function, so the compiler was able to optimize and reuse variables.
> >
> > I hope that this time I did that right (;
> >
> > Regards,
> > FCh
>
> Any comments? (;
>
> Regards,
> FCh
>
- Previous message (by thread): [PATCH] libc/time/gmtime_r.c, libc/time/lcltime_r.c,, libc/time/local.h, libc/time/mktm_r.c: move localtime related functionality, from _mktm_r() to new _mklocaltm_r() to break dependency of gmtime() on, timezones
- Next message (by thread): [PATCH] libc/time/gmtime_r.c, libc/time/lcltime_r.c,, libc/time/local.h, libc/time/mktm_r.c: move localtime related functionality, from _mktm_r() to new _mklocaltm_r() to break dependency of gmtime() on, timezones
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Newlib
mailing list