1
1
/*
2
+ Copyright (C) 2024 Intel Corporation
2
3
Copyright (c) 2003-2022, Troy D. Hanson https://troydhanson.github.io/uthash/
3
4
All rights reserved.
4
5
@@ -21,6 +22,12 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21
22
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22
23
*/
23
24
25
+ /*
26
+ Modifications by Intel:
27
+ - define uthash_malloc unconditional as a umf_ba_global_alloc
28
+ - define uthash_free unconditional as a umf_ba_global_free
29
+ */
30
+
24
31
#ifndef UTHASH_H
25
32
#define UTHASH_H
26
33
@@ -30,6 +37,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
37
#include <stdlib.h> /* exit */
31
38
#include <string.h> /* memcmp, memset, strlen */
32
39
40
+ #include "base_alloc_global.h"
41
+
33
42
#if defined(HASH_DEFINE_OWN_STDINT ) && HASH_DEFINE_OWN_STDINT
34
43
/* This codepath is provided for backward compatibility, but I plan to remove it. */
35
44
#warning \
@@ -76,12 +85,9 @@ typedef unsigned char uint8_t;
76
85
} while (0)
77
86
#endif
78
87
79
- #ifndef uthash_malloc
80
- #define uthash_malloc (sz ) malloc(sz) /* malloc fcn */
81
- #endif
82
- #ifndef uthash_free
83
- #define uthash_free (ptr , sz ) free(ptr) /* free fcn */
84
- #endif
88
+ #define uthash_malloc (sz ) umf_ba_global_alloc(sz) /* malloc fcn */
89
+ #define uthash_free (ptr , sz ) umf_ba_global_free(ptr) /* free fcn */
90
+
85
91
#ifndef uthash_bzero
86
92
#define uthash_bzero (a , n ) memset(a, '\0', n)
87
93
#endif
0 commit comments