| 43 |
However, it calls memory allocation and freeing functions via the four |
However, it calls memory allocation and freeing functions via the four |
| 44 |
indirections below, and it can optionally do callouts, using the fifth |
indirections below, and it can optionally do callouts, using the fifth |
| 45 |
indirection. These values can be changed by the caller, but are shared between |
indirection. These values can be changed by the caller, but are shared between |
| 46 |
all threads. However, when compiling for Virtual Pascal, things are done |
all threads. |
| 47 |
differently, and global variables are not used (see pcre.in). */ |
|
| 48 |
|
For MS Visual Studio and Symbian OS, there are problems in initializing these |
| 49 |
|
variables to non-local functions. In these cases, therefore, an indirection via |
| 50 |
|
a local function is used. |
| 51 |
|
|
| 52 |
|
Also, when compiling for Virtual Pascal, things are done differently, and |
| 53 |
|
global variables are not used. */ |
| 54 |
|
|
| 55 |
#ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
| 56 |
#include "config.h" |
#include "config.h" |
| 58 |
|
|
| 59 |
#include "pcre_internal.h" |
#include "pcre_internal.h" |
| 60 |
|
|
| 61 |
#ifndef VPCOMPAT |
#if defined _MSC_VER || defined __SYMBIAN32__ |
| 62 |
|
static void* LocalPcreMalloc(size_t aSize) |
| 63 |
|
{ |
| 64 |
|
return malloc(aSize); |
| 65 |
|
} |
| 66 |
|
static void LocalPcreFree(void* aPtr) |
| 67 |
|
{ |
| 68 |
|
free(aPtr); |
| 69 |
|
} |
| 70 |
|
PCRE_EXP_DATA_DEFN void *(*pcre_malloc)(size_t) = LocalPcreMalloc; |
| 71 |
|
PCRE_EXP_DATA_DEFN void (*pcre_free)(void *) = LocalPcreFree; |
| 72 |
|
PCRE_EXP_DATA_DEFN void *(*pcre_stack_malloc)(size_t) = LocalPcreMalloc; |
| 73 |
|
PCRE_EXP_DATA_DEFN void (*pcre_stack_free)(void *) = LocalPcreFree; |
| 74 |
|
PCRE_EXP_DATA_DEFN int (*pcre_callout)(pcre_callout_block *) = NULL; |
| 75 |
|
|
| 76 |
|
#elif !defined VPCOMPAT |
| 77 |
PCRE_EXP_DATA_DEFN void *(*pcre_malloc)(size_t) = malloc; |
PCRE_EXP_DATA_DEFN void *(*pcre_malloc)(size_t) = malloc; |
| 78 |
PCRE_EXP_DATA_DEFN void (*pcre_free)(void *) = free; |
PCRE_EXP_DATA_DEFN void (*pcre_free)(void *) = free; |
| 79 |
PCRE_EXP_DATA_DEFN void *(*pcre_stack_malloc)(size_t) = malloc; |
PCRE_EXP_DATA_DEFN void *(*pcre_stack_malloc)(size_t) = malloc; |