Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: LC_NUMERIC=fr_FR and floating point arithmetics



Philippe Troin wrote:
> 
> Aren't you leaking a copy of the current locale (via dupstring())
> every time?

dupstring() calls zhalloc() to allocate memory instead of zalloc()
(unlike ztrdup()). So the memory should be freed the next time popheap()
is called (which I think is done for each command line). The comment at
the top of mem.c is what I'm basing this on. So I've always assumed that
zalloc should only be used for things which need to persist from one
command to the next, where realloc() is needed or where a large chunk of
memory is needed.

Oliver



Messages sorted by: Reverse Date, Date, Thread, Author