aboutsummaryrefslogtreecommitdiffstats
path: root/com32/include/stdlib.h
diff options
context:
space:
mode:
Diffstat (limited to 'com32/include/stdlib.h')
-rw-r--r--com32/include/stdlib.h29
1 files changed, 18 insertions, 11 deletions
diff --git a/com32/include/stdlib.h b/com32/include/stdlib.h
index 2135569b..fad0082d 100644
--- a/com32/include/stdlib.h
+++ b/com32/include/stdlib.h
@@ -44,23 +44,30 @@ __extern int posix_memalign(void **memptr, size_t alignment,
__extern void free(void *);
+__extern void *__malloc_global_tag;
-__extern void *__mem_get_tag_global(void);
-__extern void __mem_set_tag_global(void *tag);
-
-__extern void *__mem_get_tag(void *memptr);
-__extern void __mem_set_tag(void *memptr, void *tag);
+static __inline__ void *__mem_get_tag_global(void)
+{
+ return __malloc_global_tag;
+}
-__extern void __free_tagged(void *tag);
+static __inline__ void __mem_set_tag_global(void *__tag)
+{
+ __malloc_global_tag = __tag;
+}
-static __inline__ void *__malloc_tagged(size_t size, void *tag) {
- void *result = malloc(size);
- __mem_set_tag(result, tag);
+__extern void *__mem_get_tag(void *);
+__extern void __mem_set_tag(void *, void *);
- return result;
-}
+__extern void __free_tagged(void *);
+static __inline__ void *__malloc_tagged(size_t __size, void *__tag)
+{
+ void *__result = malloc(__size);
+ __mem_set_tag(__result, __tag);
+ return __result;
+}
__extern long strtol(const char *, char **, int);
__extern long long strtoll(const char *, char **, int);