aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/malloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'com32/lib/malloc.c')
-rw-r--r--com32/lib/malloc.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/com32/lib/malloc.c b/com32/lib/malloc.c
index 405e6435..50359934 100644
--- a/com32/lib/malloc.c
+++ b/com32/lib/malloc.c
@@ -15,7 +15,7 @@
/**
* The global tag used to label all the new allocations
*/
-static void *__global_tag = NULL;
+void *__malloc_global_tag = NULL;
struct free_arena_header __malloc_head =
{
@@ -119,7 +119,7 @@ static void *__malloc_from_block(struct free_arena_header *fp, size_t size)
nfp->a.tag = NULL;
ARENA_TYPE_SET(fp->a.attrs, ARENA_TYPE_USED);
ARENA_SIZE_SET(fp->a.attrs, size);
- fp->a.tag = __global_tag;
+ fp->a.tag = __malloc_global_tag;
/* Insert into all-block chain */
nfp->a.prev = fp;
@@ -135,7 +135,7 @@ static void *__malloc_from_block(struct free_arena_header *fp, size_t size)
} else {
/* Allocate the whole block */
ARENA_TYPE_SET(fp->a.attrs, ARENA_TYPE_USED);
- fp->a.tag = __global_tag;
+ fp->a.tag = __malloc_global_tag;
/* Remove from free chain */
fp->next_free->prev_free = fp->prev_free;
@@ -251,20 +251,12 @@ int posix_memalign(void **memptr, size_t alignment, size_t size)
return 0;
}
-void *__mem_get_tag_global(void) {
- return __global_tag;
-}
-
-void __mem_set_tag_global(void *tag) {
- __global_tag = tag;
-}
-
void *__mem_get_tag(void *memptr) {
- struct arena_header *ah = (struct arena_header*)memptr - 1;
+ struct arena_header *ah = (struct arena_header *)memptr - 1;
return ah->tag;
}
void __mem_set_tag(void *memptr, void *tag) {
- struct arena_header *ah = (struct arena_header*)memptr - 1;
+ struct arena_header *ah = (struct arena_header *)memptr - 1;
ah->tag = tag;
}