Roland Mainz wrote:
> Nicolas Williams wrote:
>
>> On Fri, Dec 19, 2008 at 09:14:37PM +0100, Roland Mainz wrote:
>>
>>> Will this even work if another library is used for |malloc()|&&|free()|
>>> calls (IMO it should work but I am not sure about the case when an
>>> application is linked via -B direct) ?
>>>
>> Yes, it will: malloc() and friends are marked as NODIRECT in libc, which
>> means they can be interposed on freely by the application, even when
>> they are called from within libc itself.
>>
>
> Devils advocate question:
> What happens if someone intercepts |asprintf()| or |vasprintf()| with
> his/her own function which doesn't use the default |malloc()| () ?
>
Then they better impose a reasonable malloc/free, or a free that works
with both their allocators as well as malloc() memory.
Why would anyone want to do this, btw? (Replacing the system malloc I
understand. Replacing these functions with a version that doesn't use
malloc() seems questionable, though.)
--Garrett
> ----
>
> Bye,
> Roland
>
>