in reply to XS malloc and free
Googling for "Free to wrong pool" shows that this error is specific to Perl, so your call to free() is calling Perl's own free() but surely your library isn't calling Perl's own malloc(). And my keen insight tells me that this is probably due to a C-preprocessor macro. So I chdir to perl/lib/CORE and "grep free *.h" and get:
XSUB.h:# define free PerlMem_free
which is unfortunate. Preventing XS routines from being able to easily choose which malloc system they want to use (Perl's or C's -- which are sometimes the same) is not the best idea.
In the meantime, you can "#undef free" before your call to free() to work around the problem (but don't use "free" any further down in your code, even indirectly via some other obscure C-preprocessor macro).
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: XS malloc and free (whose)
by BrowserUk (Patriarch) on Feb 07, 2006 at 20:07 UTC | |
by tye (Sage) on Feb 07, 2006 at 20:26 UTC | |
by BrowserUk (Patriarch) on Feb 07, 2006 at 20:59 UTC | |
by Brutha (Friar) on Feb 08, 2006 at 07:08 UTC | |
by BrowserUk (Patriarch) on Feb 08, 2006 at 08:08 UTC | |
|
Re^2: XS malloc and free (whose)
by ikegami (Patriarch) on Feb 07, 2006 at 19:15 UTC | |
by tye (Sage) on Feb 07, 2006 at 20:17 UTC |