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

トップ ページ
このメッセージを削除
著者: Sheri
日付:  
To: pcre-dev
CC: pcre-dev
題目: 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