#define RESERVE_SIZE (((HDR_SIZE + (ALIGN_SIZE-1)) \
/ ALIGN_SIZE ) * ALIGN_SIZE)
-#define MAX_SIZE_T ((size_t)-1)
#define CLIENT_2_HDR(a) ((MEMHDR *) (((char *) (a)) - RESERVE_SIZE))
#define HDR_2_CLIENT(a) ((void *) (((char *) (a)) + RESERVE_SIZE))
/**
* xmlMallocAtomicLoc:
- * @size: an unsigned int specifying the size in byte to allocate.
+ * @size: an int specifying the size in byte to allocate.
* @file: the file name or NULL
* @line: the line number
*
TEST_POINT
- if (size > (MAX_SIZE_T - RESERVE_SIZE)) {
- xmlGenericError(xmlGenericErrorContext,
- "xmlMallocAtomicLoc : Unsigned overflow prevented\n");
- xmlMemoryDump();
- return(NULL);
- }
-
p = (MEMHDR *) malloc(RESERVE_SIZE+size);
if (!p) {
xmlGenericError(xmlGenericErrorContext,
- "xmlMallocAtomicLoc : Out of free space\n");
+ "xmlMallocLoc : Out of free space\n");
xmlMemoryDump();
return(NULL);
}
int
xmlMemUsed(void) {
- int res;
-
- xmlMutexLock(xmlMemMutex);
- res = debugMemSize;
- xmlMutexUnlock(xmlMemMutex);
- return(res);
+ return(debugMemSize);
}
/**
int
xmlMemBlocks(void) {
- int res;
-
- xmlMutexLock(xmlMemMutex);
- res = debugMemBlocks;
- xmlMutexUnlock(xmlMemMutex);
- return(res);
+ return(debugMemBlocks);
}
#ifdef MEM_LIST