summaryrefslogtreecommitdiff
path: root/libc/stdlib/malloc/malloc.h
diff options
context:
space:
mode:
authorMiles Bader <miles@lsi.nec.co.jp>2002-07-30 09:45:58 +0000
committerMiles Bader <miles@lsi.nec.co.jp>2002-07-30 09:45:58 +0000
commit9b14b185b1f7bd09993a3b79902eee2521f89310 (patch)
tree2c401021919a524099ba55da76d332da1bec3631 /libc/stdlib/malloc/malloc.h
parent8ff1de76b6f5a0d3d50b8e55a392e6c85b914a5e (diff)
Define MALLOC_SET_SIZE to take the user-address rather than the base-address.
Diffstat (limited to 'libc/stdlib/malloc/malloc.h')
-rw-r--r--libc/stdlib/malloc/malloc.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/libc/stdlib/malloc/malloc.h b/libc/stdlib/malloc/malloc.h
index f08f4bf1b..8abc9ed4f 100644
--- a/libc/stdlib/malloc/malloc.h
+++ b/libc/stdlib/malloc/malloc.h
@@ -56,11 +56,11 @@
#define MALLOC_BASE(addr) ((void *)((char *)addr - MALLOC_ALIGNMENT))
/* Return the size of a malloc allocation, given the user address. */
#define MALLOC_SIZE(addr) (*(size_t *)MALLOC_BASE(addr))
+/* Sets the size of a malloc allocation, given the user address. */
+#define MALLOC_SET_SIZE(addr, size) (*(size_t *)MALLOC_BASE(addr) = (size))
/* Return the user address of a malloc allocation, given the base address. */
#define MALLOC_ADDR(base) ((void *)((char *)base + MALLOC_ALIGNMENT))
-/* Sets the size of a malloc allocation, given the base address. */
-#define MALLOC_SET_SIZE(base, size) (*(size_t *)(base) = (size))
#ifdef __UCLIBC_HAS_THREADS__