]> Git Repo - uclibc-ng.git/commitdiff
(MALLOC_HEADER_SIZE): New macro.
authorMiles Bader <[email protected]>
Wed, 31 Jul 2002 02:09:37 +0000 (02:09 -0000)
committerMiles Bader <[email protected]>
Wed, 31 Jul 2002 02:09:37 +0000 (02:09 -0000)
(MALLOC_BASE, MALLOC_ADDR): Use it.

libc/stdlib/malloc/malloc.h

index 8abc9ed4ff12cc44a3a7a6a6ba2b675e52859283..193dabd64c9d3631e8aba530f0648fa1694ecf3f 100644 (file)
      ^ ADDR - MALLOC_ALIGN
 */
 
+/* The amount of extra space used by the malloc header.  */
+#define MALLOC_HEADER_SIZE     MALLOC_ALIGNMENT
+
 /* Return base-address of a malloc allocation, given the user address.  */
-#define MALLOC_BASE(addr)      ((void *)((char *)addr - MALLOC_ALIGNMENT))
+#define MALLOC_BASE(addr)      ((void *)((char *)addr - MALLOC_HEADER_SIZE))
 /* 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))
+#define MALLOC_ADDR(base)      ((void *)((char *)base + MALLOC_HEADER_SIZE))
 
 
+/* Locking for multithreaded apps.  */
 #ifdef __UCLIBC_HAS_THREADS__
 
 # include <pthread.h>
This page took 0.03317 seconds and 4 git commands to generate.