Re: [pcre-dev] A test for the memory mismatch problem

Kezdőlap
Üzenet törlése
Szerző: Sheri
Dátum:  
Címzett: pcre-dev
CC: pcre-dev
Tárgy: Re: [pcre-dev] A test for the memory mismatch problem
Hey Philip, I see some other notes in the old NON-UNIX USE (haven't
looked at the new one yet) about missing function pointers for malloc
and free.

Should we try adding this bit to pcre.h or pcretest.c?

=========================
#ifdef _WIN32
#include <malloc.h>

void* malloc_stub(size_t N)
{ return malloc(N); }
void free_stub(void* p)
{ free(p); }
void *(*pcre_malloc)(size_t) = &malloc_stub;
void (*pcre_free)(void *) = &free_stub;

#else

void *(*pcre_malloc)(size_t) = malloc;
void (*pcre_free)(void *) = free;

#endif
=========================

Regards,
Sheri