Dnia Wed, May 01, 2024 at 03:03:27PM +0100, John-Mark Bell napisał(a):
> 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.
OK. Thanks.
BTW, gcc-14 reports inverted order of parameters for calloc as en error.
calloc(sizeof(*something), 1) BAD
calloc(1, sizeof(*something)) OK
Witold Filipczyk
No comments:
Post a Comment