Wednesday, 1 May 2024

[netsurf-dev] Re: [PATCH] Custom memory functions

On 01/05/2024 10:23, Witold Filipczyk (witekfl) wrote:
> Hello,
> I want to add custom memory allocators like in other libraries.
> This will help to debug possible memory leaks in programs.
> First parserutils. It is based on curl.
>
> Will you accept such patches?

We used to have such a thing in most of the libraries, but it resulted
in a great deal of complexity for no real gain (particularly as memory
leaks can be detected using tools such as libefence, valgrind, and asan,
amongst others).

Custom allocator support was removed from libparserutils here:
https://git.netsurf-browser.org/libparserutils.git/commit/?id=8e48b931091cbc99abeffacc7af80f363495ec23

I don't think we want to reintroduce any of these (as libefence and
friends demonstrate, you can inject your own allocator anyway via
LD_PRELOAD (if dynamically linking) or by statically linking against
libefence, whose symbols should bind tighter than those in the C runtime
library.


John-Mark.

No comments:

Post a Comment