
steve.m.hay at googlemail
Nov 7, 2009, 5:58 PM
Post #4 of 5
(74 views)
Permalink
|
2009/11/7 Nicholas Clark <nick[at]ccl4.org>: > On Sat, Nov 07, 2009 at 12:03:36PM -0700, Curtis Jewell wrote: >> kmx> without this patch GDBM_File tests ended with an error: "Free to >> wrong pool ..." when calling free(str) > > On the assumption that the patch solved something, I'd figured out that this > would be the problem. > > What in the perl source code is redefining free? XSUB.h, iperlsys.h and win32iop.h. XSUB.h defines free as PerlMem_free. Then iperlsys.h defines PerlMem_free(buf) as either (*PL_Mem->pFree)(PL_Mem, (buf)) or as free((buf)) if PERL_IMPLICIT_SYS is defined or not respectively. In the latter case, win32iop.h then defines free as win32_free (because WIN32IO_IS_STDIO is not defined in win32.h in this case). In the former (PERL_IMPLICIT_SYS) case the *PL_Mem->pFree call goes through the perlhost layer and in this case lands up in VMem::Free() in vmem.h, which is where the Free to wrong pool comes from. > Is there any "official" way to get back to the system's free? I don't know. In the case of IO functions there are SIO names (e.g. PerlSIO_fopen()) for accessing the original system calls, but I don't see a similar set-up for malloc/free.
|