Re: Changing default alloc routines in C

Burlen Loring <[email protected]> Wed, 28 Dec 2022 12:06:30 -0800
Newsgroups gmane.comp.programming.swig
Message-ID <[email protected]>
Yes. GNU has some documentation about how you replace malloc.
https://www.gnu.org/software/libc/manual/html_node/Replacing-malloc.html



On 12/14/22 21:25, Mayank Chaudhary wrote:
> Hi, I'm new to swig and am generating C wrappers using it.
>
> Swig uses default malloc and calloc functions for memory allocations 
> while generating wrappers. Is there any way where I can specify a 
> custom allocation function in the interface file and use that instead 
> of malloc and calloc?
>
> *For example - something like my_malloc, my_calloc and my_free or any 
> custom func(I have defined these functions in a separate file) to be 
> used everywhere instead of malloc, calloc and free*
>
> I tried typemaps and renaming functions but that didn't work.
>
> Requesting your support.
>
> Thanks & Regards,
> Mayank
>
>
> _______________________________________________
> Swig-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/swig-user

_______________________________________________
Swig-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/swig-user