develooper Front page | perl.perl5.porters | Postings from September 2009

Embedding Perl but redefining its malloc()

Thread Next
Raphael Manfredi
September 24, 2009 06:14
Embedding Perl but redefining its malloc()
Message ID:

I'm currently seriously considering embedding a Perl interpreter in one
of my C programs, to be able to benefit from all the good things Perl
brings us.

I have been away from the Perl development community for quite some years
now and I have not been following closely how Perl5 evolved.

Is there an easy way to redefine Perl's malloc() routine to use that of my
C program, which uses a custom malloc?

I'm not talking about having a new malloc() routine defining the
malloc symbol.  I'm talking about whether Perl uses a "virtual table"
for memory allocation, and whether I could redefine this virtual table
to supply malloc(), realloc() and free() function pointers, so that the
embedded Perl interpreter would use my custom memory allocation routines.


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About