|
From: | Paul Eggert |
Subject: | Re: JSON/YAML/TOML/etc. parsing performance |
Date: | Sun, 8 Oct 2017 23:19:28 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
Philipp Stephani wrote:
I don't think Jansson can use xmalloc because xmalloc can exit nonlocally, which is not expected by a third-party library such as Jansson. It could use a suitable wrapper of lmalloc, though.
That would be overkill, as lmalloc arranges for Lisp alignment, which Jansson does not need. We could define new functions (smalloc and srealloc, say), that act like malloc and realloc except they return NULL for requests larger than PTRDIFF_MAX. Right now, I expect only the JSON code needs this sort of thing so we could put the new functions in json.c. If other code needs it later we could move these new functions to alloc.c.
[Prev in Thread] | Current Thread | [Next in Thread] |