[tz] Troll throws zic for a loop
Paul Eggert
eggert at cs.ucla.edu
Fri Mar 21 14:35:42 UTC 2014
Marc Lehmann wrote:
> If the number of transitions in the table is ultimately bounded (which
> seems to be the case here), then not using malloc is safer, faster,
> simpler, more memory efficient, and cleaner for zic.
Having zic avoid malloc is less resilient in the face of future changes,
such as the ones needed for Troll. If zic had already been using
malloc, we could ship the new Antarctica/Troll now, without worrying
about old zic implementations rejecting it. If zic starts using malloc
now, future changes like this should be easier to deploy.
Plus, zic is already using malloc elsewhere, so using malloc for these
cases doesn't introduce any fundamental new problems.
malloc is more problematic for localtime, not just in terms of runtime
overhead, but in terms of safety and correctness: there are applications
where it's not nice to display the time incorrectly (or not at all -- or
worse, dump core) merely because malloc failed. There are embedded
environments where use of malloc is frowned upon entirely, for these
reasons. These considerations generally don't apply to zic, which makes
it more reasonable to use malloc in zic than in localtime.
More information about the tz
mailing list