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

Re: When is mem.c / malloc called?



On Feb 10,  4:24am, Sebastian Gniazdowski wrote:
}
} ... compiled once without --enable-zsh-mem, once with it. Then in a
} module I've called zshcalloc() and malloc(). Didn't get the message.

--enable-zsh-mem should turn on the internal malloc, see line 1026 of
mem.c.  However, if you didn't relink separately-compiled modules,
they might still link at runtime to the system malloc.

} I'm writing a module that needs thread safe memory allocation.

This sounds pretty dangerous, as the rest of zsh (signal handling in
particular, update of the environment on e.g. "export", etc.) is not
going to be thread-safe.



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