Skip to content

Commit 8d58958

Browse files
committed
Use the UMF base allocator in UThash
1 parent c795844 commit 8d58958

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/uthash/uthash.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030
#include <stdlib.h> /* exit */
3131
#include <string.h> /* memcmp, memset, strlen */
3232

33+
#include "base_alloc_global.h"
34+
3335
#if defined(HASH_DEFINE_OWN_STDINT) && HASH_DEFINE_OWN_STDINT
3436
/* This codepath is provided for backward compatibility, but I plan to remove it. */
3537
#warning \
@@ -77,10 +79,10 @@ typedef unsigned char uint8_t;
7779
#endif
7880

7981
#ifndef uthash_malloc
80-
#define uthash_malloc(sz) malloc(sz) /* malloc fcn */
82+
#define uthash_malloc(sz) umf_ba_global_alloc(sz) /* malloc fcn */
8183
#endif
8284
#ifndef uthash_free
83-
#define uthash_free(ptr, sz) free(ptr) /* free fcn */
85+
#define uthash_free(ptr, sz) umf_ba_global_free(ptr) /* free fcn */
8486
#endif
8587
#ifndef uthash_bzero
8688
#define uthash_bzero(a, n) memset(a, '\0', n)

0 commit comments

Comments
 (0)