This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC 1/2] Adding custom destructor for free.

On Tue, Nov 19, 2013 at 11:29:27AM +0100, Florian Weimer wrote:
> On 11/11/2013 03:20 PM, OndÅej BÃlka wrote:
> >I wonder if this would be a core functionality or by adding new
> >library?
> There are already libraries for doing this.  Adding it to libc would
> only help if the existing (incompatible) libraries would standardize
> on the libc interfaces, which seems unlikely.
Could you provide links? Do they require to use other function than free
which makes them less flexible?
I want to know what features they offer and what could be standardized.

A custom free here is more a prerequisite for other features.

> I also think it's hardly radical enough, given that it negatively
> interacts with malloc hooking.
Not necceassarily. I could make these features working on arbitrary
allocator with small slowdown. A custom allocator could get these
features by -lmalloc_intercept which would handle these for him.
Alternatively when allocator is LD_PRELOADED then use

Doing this would help as already you cannot expect malloc_hook work
with custom allocator. 

Then there is a hack, that we could make linker prepend LD_PRELOAD with
intercept library which would work always but is ugly.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]