Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit 5f3ca31

Browse files
committed
globals: Fix --with-thread-alloc build
1 parent 159d55f commit 5f3ca31

1 file changed

Lines changed: 32 additions & 5 deletions

File tree

globals.c

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -598,11 +598,11 @@ xmlInitGlobalState(xmlGlobalStatePtr gs) {
598598

599599
#ifdef LIBXML_THREAD_ALLOC_ENABLED
600600
/* XML_GLOBALS_ALLOC */
601-
gs->gs_xmlFree = free;
602-
gs->gs_xmlMalloc = malloc;
603-
gs->gs_xmlMallocAtomic = malloc;
604-
gs->gs_xmlRealloc = realloc;
605-
gs->gs_xmlMemStrdup = xmlPosixStrdup;
601+
gs->free = free;
602+
gs->malloc = malloc;
603+
gs->mallocAtomic = malloc;
604+
gs->realloc = realloc;
605+
gs->memStrdup = xmlPosixStrdup;
606606
#endif
607607

608608
xmlMutexLock(&xmlThrDefMutex);
@@ -754,6 +754,33 @@ __xmlOutputBufferCreateFilenameValue(void) {
754754
return(&xmlGetThreadLocalStorage(0)->outputBufferCreateFilenameValue);
755755
}
756756

757+
#ifdef LIBXML_THREAD_ALLOC_ENABLED
758+
xmlMallocFunc *
759+
__xmlMalloc(void) {
760+
return(&xmlGetThreadLocalStorage(0)->malloc);
761+
}
762+
763+
xmlMallocFunc *
764+
__xmlMallocAtomic(void) {
765+
return(&xmlGetThreadLocalStorage(0)->mallocAtomic);
766+
}
767+
768+
xmlReallocFunc *
769+
__xmlRealloc(void) {
770+
return(&xmlGetThreadLocalStorage(0)->realloc);
771+
}
772+
773+
xmlFreeFunc *
774+
__xmlFree(void) {
775+
return(&xmlGetThreadLocalStorage(0)->free);
776+
}
777+
778+
xmlStrdupFunc *
779+
__xmlMemStrdup(void) {
780+
return(&xmlGetThreadLocalStorage(0)->memStrdup);
781+
}
782+
#endif /* LIBXML_THREAD_ALLOC_ENABLED */
783+
757784
/**
758785
* xmlGetLocalRngState:
759786
*

0 commit comments

Comments
 (0)