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