|
|
| version 1.152.2.19.2.20, 2003/07/23 08:40:40 | version 1.161, 2003/11/20 16:34:26 |
|---|---|
| Line 5 | Line 5 |
| Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) | Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) |
| */ | */ |
| static const char* IDENT_GLOBALS_C="$Date$"; | static const char * const IDENT_GLOBALS_C="$Date$"; |
| #include "pa_config_includes.h" | #include "pa_config_includes.h" |
| Line 99 XML_Generic_error_info *xml_generic_erro | Line 99 XML_Generic_error_info *xml_generic_erro |
| } | } |
| static void | static void |
| xmlParserGenericErrorFunc(void *ctx, const char* msg, ...) { | xmlParserGenericErrorFunc(void * /*ctx*/, const char* msg, ...) { |
| //_asm int 3; | //_asm int 3; |
| pa_thread_t thread_id=pa_get_thread_id(); | pa_thread_t thread_id=pa_get_thread_id(); |
| Line 225 void pa_globals_destroy(void *) { | Line 225 void pa_globals_destroy(void *) { |
| #ifdef XML | #ifdef XML |
| GdomeException exc; | GdomeException exc; |
| gdome_di_unref (domimpl, &exc); | gdome_di_unref (domimpl, &exc); |
| // uncomment SAPI::abort below if adding potential-throw code here | |
| #endif | #endif |
| } catch(const Exception& e) { | } catch(const Exception& e) { |
| SAPI::abort("pa_globals_destroy failed: %s", e.comment()); | // SAPI::abort("pa_globals_destroy failed: %s", e.comment()); |
| } | } |
| } | } |
| Line 240 static char *pa_GC_strdup(const char *s) | Line 241 static char *pa_GC_strdup(const char *s) |
| size_t size=strlen(s)+1; | size_t size=strlen(s)+1; |
| char *result=(char *)GC_malloc_atomic(size); | char *result=(char *)GC_malloc_atomic(size); |
| if(!result) | |
| SAPI::abort("out of memory (while duplicating XML string [size=%d])", size); | |
| memcpy(result, s, size); | memcpy(result, s, size); |
| return result; | return result; |
| } | } |
| Line 282 static void pa_gc_free_log(void *p){ | Line 286 static void pa_gc_free_log(void *p){ |
| // fprintf(stderr,"catched debug free(0x%p)\n", p); | // fprintf(stderr,"catched debug free(0x%p)\n", p); |
| pa_gc_free(p); | pa_gc_free(p); |
| } | } |
| #else | |
| inline void *check(void *result, const char *where, size_t size) { | |
| if(!result) | |
| SAPI::abort("out of memory (while %s [size=%d])", where, size); | |
| return result; | |
| } | |
| static void* pa_gc_malloc_nonull(size_t size) { | |
| return check(pa_gc_malloc(size), "allocating XML compsite memory", size); | |
| } | |
| static void* pa_gc_malloc_atomic_nonull(size_t size) { | |
| return check(pa_gc_malloc_atomic(size), "allocating XML atomic memory", size); | |
| } | |
| static void* pa_gc_realloc_nonull(void* ptr, size_t size) { | |
| return check(pa_gc_realloc(ptr, size), "reallocating XML memory", size); | |
| } | |
| #endif | #endif |
| #endif | #endif |
| Line 290 void pa_CORD_oom_fn(void) { | Line 312 void pa_CORD_oom_fn(void) { |
| } | } |
| /** | /** |
| @todo LIBXML_VERSION with xmlGcMemSetup will be 2.5.7 | |
| @todo gc: libltdl: substitute lt_dlmalloc & co | @todo gc: libltdl: substitute lt_dlmalloc & co |
| */ | */ |
| static void gc_substitute_memory_management_functions() { | static void gc_substitute_memory_management_functions() { |
| Line 308 static void gc_substitute_memory_managem | Line 329 static void gc_substitute_memory_managem |
| #else | #else |
| xmlGcMemSetup( | xmlGcMemSetup( |
| /*xmlFreeFunc */pa_gc_free, | /*xmlFreeFunc */pa_gc_free, |
| /*xmlMallocFunc */pa_gc_malloc, | /*xmlMallocFunc */pa_gc_malloc_nonull, |
| /*xmlMallocFunc */pa_gc_malloc_atomic, | /*xmlMallocFunc */pa_gc_malloc_atomic_nonull, |
| /*xmlReallocFunc */pa_gc_realloc, | /*xmlReallocFunc */pa_gc_realloc_nonull, |
| /*xmlStrdupFunc */pa_GC_strdup); | /*xmlStrdupFunc */pa_GC_strdup); |
| #endif | #endif |
| Line 402 void pa_globals_init() { | Line 423 void pa_globals_init() { |
| #ifdef _MSC_VER | #ifdef _MSC_VER |
| #ifndef PA_DEBUG_DISABLE_GC | #ifndef PA_DEBUG_DISABLE_GC |
| # define GC_LIB "/parser3project/win32/gc" | # define GC_LIB "../../../../win32/gc" |
| # ifdef _DEBUG | # ifdef _DEBUG |
| # pragma comment(lib, GC_LIB "/Debug/gc.lib") | # pragma comment(lib, GC_LIB "/Debug/gc.lib") |
| # else | # else |
| Line 412 void pa_globals_init() { | Line 433 void pa_globals_init() { |
| #endif | #endif |
| #ifdef XML | #ifdef XML |
| # define GNOME_LIBS "/parser3project/win32xml/win32/gnome" | # define GNOME_LIBS "../../../../win32/gnome" |
| # pragma comment(lib, GNOME_LIBS "/glib/lib/libglib-1.3-11.lib") | # pragma comment(lib, GNOME_LIBS "/glib/lib/libglib-1.3-11.lib") |
| # ifdef _DEBUG | # ifdef _DEBUG |
| # ifdef LIBXML_STATIC | # ifdef LIBXML_STATIC |
| # pragma comment(lib, GNOME_LIBS "/gnome-xml/win32/binaries/libxml2_a.lib") | # pragma comment(lib, GNOME_LIBS "/gnome-xml/win32/binaries-debug/libxml2_a.lib") |
| # else | # else |
| # pragma comment(lib, GNOME_LIBS "/gnome-xml/win32/binaries/libxml2.lib") | # pragma comment(lib, GNOME_LIBS "/gnome-xml/win32/binaries-debug/libxml2.lib") |
| # endif | # endif |
| # ifdef LIBXSLT_STATIC | # ifdef LIBXSLT_STATIC |
| Line 442 void pa_globals_init() { | Line 463 void pa_globals_init() { |
| #else | #else |
| # ifdef LIBXML_STATIC | # ifdef LIBXML_STATIC |
| # pragma comment(lib, GNOME_LIBS "/gnome-xml/win32/dsp/libxml2_ReleaseStatic/libxml2.lib") | # pragma comment(lib, GNOME_LIBS "/gnome-xml/win32/binaries-release/libxml2_a.lib") |
| # else | # else |
| # pragma comment(lib, GNOME_LIBS "/gnome-xml/win32/dsp/libxml2_ReleaseDynamic/libxml2.lib") | # pragma comment(lib, GNOME_LIBS "/gnome-xml/win32/binaries-release/libxml2.lib") |
| # endif | # endif |
| # ifdef LIBXSLT_STATIC | # ifdef LIBXSLT_STATIC |