/[pcre]/code/branches/pcre16/pcre_globals.c
ViewVC logotype

Diff of /code/branches/pcre16/pcre_globals.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 77 by nigel, Sat Feb 24 21:40:45 2007 UTC revision 497 by ph10, Wed Mar 3 12:01:00 2010 UTC
# Line 6  Line 6 
6  and semantics are as close as possible to those of the Perl 5 language.  and semantics are as close as possible to those of the Perl 5 language.
7    
8                         Written by Philip Hazel                         Written by Philip Hazel
9             Copyright (c) 1997-2005 University of Cambridge             Copyright (c) 1997-2008 University of Cambridge
10    
11  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
12  Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
# Line 43  PCRE is thread-clean and doesn't use any Line 43  PCRE is thread-clean and doesn't use any
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.
 differently, and global variables are not used (see pcre.in). */  
47    
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  #include "pcre_internal.h"  Also, when compiling for Virtual Pascal, things are done differently, and
53    global variables are not used. */
54    
55  #ifndef VPCOMPAT  #ifdef HAVE_CONFIG_H
56  #ifdef __cplusplus  #include "config.h"
 extern "C" void *(*pcre_malloc)(size_t) = malloc;  
 extern "C" void  (*pcre_free)(void *) = free;  
 extern "C" void *(*pcre_stack_malloc)(size_t) = malloc;  
 extern "C" void  (*pcre_stack_free)(void *) = free;  
 extern "C" int   (*pcre_callout)(pcre_callout_block *) = NULL;  
 #else  
 void *(*pcre_malloc)(size_t) = malloc;  
 void  (*pcre_free)(void *) = free;  
 void *(*pcre_stack_malloc)(size_t) = malloc;  
 void  (*pcre_stack_free)(void *) = free;  
 int   (*pcre_callout)(pcre_callout_block *) = NULL;  
57  #endif  #endif
58    
59    #include "pcre_internal.h"
60    
61    #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;
78    PCRE_EXP_DATA_DEFN void  (*pcre_free)(void *) = free;
79    PCRE_EXP_DATA_DEFN void *(*pcre_stack_malloc)(size_t) = malloc;
80    PCRE_EXP_DATA_DEFN void  (*pcre_stack_free)(void *) = free;
81    PCRE_EXP_DATA_DEFN int   (*pcre_callout)(pcre_callout_block *) = NULL;
82  #endif  #endif
83    
84  /* End of pcre_globals.c */  /* End of pcre_globals.c */

Legend:
Removed from v.77  
changed lines
  Added in v.497

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12