mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
- Makes memory check conditionally
modified: storage/connect/libdoc.cpp
This commit is contained in:
parent
59b3833c41
commit
ffedc6b891
1 changed files with 13 additions and 13 deletions
|
@ -30,11 +30,11 @@ extern char version[];
|
|||
extern int trace;
|
||||
} // "C"
|
||||
|
||||
#if defined(_DEBUG)
|
||||
static xmlFreeFunc Free;
|
||||
static xmlMallocFunc Malloc;
|
||||
static xmlMallocFunc MallocA;
|
||||
static xmlReallocFunc Realloc;
|
||||
#if defined(MEMORY_TRACE)
|
||||
static xmlFreeFunc Free;
|
||||
static xmlMallocFunc Malloc;
|
||||
static xmlMallocFunc MallocA;
|
||||
static xmlReallocFunc Realloc;
|
||||
static xmlStrdupFunc Strdup;
|
||||
|
||||
void xmlMyFree(void *mem)
|
||||
|
@ -75,7 +75,7 @@ char *xmlMyStrdup(const char *str)
|
|||
htrc("Duplicating to %p from %p %s\n", p, str, str);
|
||||
return p;
|
||||
} // end of xmlMyStrdup
|
||||
#endif // _DEBUG
|
||||
#endif // MEMORY_TRACE
|
||||
|
||||
/******************************************************************/
|
||||
/* Return a LIBXMLDOC as a XMLDOC. */
|
||||
|
@ -91,17 +91,17 @@ PXDOC GetLibxmlDoc(PGLOBAL g, char *nsl, char *nsdf,
|
|||
/******************************************************************/
|
||||
void XmlInitParserLib(void)
|
||||
{
|
||||
#if defined(_DEBUG)
|
||||
#if defined(MEMORY_TRACE)
|
||||
int rc = xmlGcMemGet(&Free, &Malloc, &MallocA, &Realloc, &Strdup);
|
||||
|
||||
if (!rc)
|
||||
rc = xmlGcMemSetup(xmlMyFree,
|
||||
xmlMyMalloc,
|
||||
xmlMyMallocAtomic,
|
||||
xmlMyRealloc,
|
||||
xmlMyStrdup);
|
||||
rc = xmlGcMemSetup(xmlMyFree,
|
||||
xmlMyMalloc,
|
||||
xmlMyMallocAtomic,
|
||||
xmlMyRealloc,
|
||||
xmlMyStrdup);
|
||||
|
||||
#endif // _DEBUG
|
||||
#endif // MEMORY_TRACE
|
||||
xmlInitParser();
|
||||
} // end of XmlInitParserLib
|
||||
|
||||
|
|
Loading…
Reference in a new issue