mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
- Makes memory check conditionally
modified: storage/connect/libdoc.cpp
This commit is contained in:
@@ -30,11 +30,11 @@ extern char version[];
|
|||||||
extern int trace;
|
extern int trace;
|
||||||
} // "C"
|
} // "C"
|
||||||
|
|
||||||
#if defined(_DEBUG)
|
#if defined(MEMORY_TRACE)
|
||||||
static xmlFreeFunc Free;
|
static xmlFreeFunc Free;
|
||||||
static xmlMallocFunc Malloc;
|
static xmlMallocFunc Malloc;
|
||||||
static xmlMallocFunc MallocA;
|
static xmlMallocFunc MallocA;
|
||||||
static xmlReallocFunc Realloc;
|
static xmlReallocFunc Realloc;
|
||||||
static xmlStrdupFunc Strdup;
|
static xmlStrdupFunc Strdup;
|
||||||
|
|
||||||
void xmlMyFree(void *mem)
|
void xmlMyFree(void *mem)
|
||||||
@@ -75,7 +75,7 @@ char *xmlMyStrdup(const char *str)
|
|||||||
htrc("Duplicating to %p from %p %s\n", p, str, str);
|
htrc("Duplicating to %p from %p %s\n", p, str, str);
|
||||||
return p;
|
return p;
|
||||||
} // end of xmlMyStrdup
|
} // end of xmlMyStrdup
|
||||||
#endif // _DEBUG
|
#endif // MEMORY_TRACE
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
/* Return a LIBXMLDOC as a XMLDOC. */
|
/* Return a LIBXMLDOC as a XMLDOC. */
|
||||||
@@ -91,17 +91,17 @@ PXDOC GetLibxmlDoc(PGLOBAL g, char *nsl, char *nsdf,
|
|||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
void XmlInitParserLib(void)
|
void XmlInitParserLib(void)
|
||||||
{
|
{
|
||||||
#if defined(_DEBUG)
|
#if defined(MEMORY_TRACE)
|
||||||
int rc = xmlGcMemGet(&Free, &Malloc, &MallocA, &Realloc, &Strdup);
|
int rc = xmlGcMemGet(&Free, &Malloc, &MallocA, &Realloc, &Strdup);
|
||||||
|
|
||||||
if (!rc)
|
if (!rc)
|
||||||
rc = xmlGcMemSetup(xmlMyFree,
|
rc = xmlGcMemSetup(xmlMyFree,
|
||||||
xmlMyMalloc,
|
xmlMyMalloc,
|
||||||
xmlMyMallocAtomic,
|
xmlMyMallocAtomic,
|
||||||
xmlMyRealloc,
|
xmlMyRealloc,
|
||||||
xmlMyStrdup);
|
xmlMyStrdup);
|
||||||
|
|
||||||
#endif // _DEBUG
|
#endif // MEMORY_TRACE
|
||||||
xmlInitParser();
|
xmlInitParser();
|
||||||
} // end of XmlInitParserLib
|
} // end of XmlInitParserLib
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user