소스 검색

Define MALLOC_SET_SIZE to take the user-address rather than the base-address.

Miles Bader 23 년 전
부모
커밋
9b14b185b1
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      libc/stdlib/malloc/malloc.h

+ 2 - 2
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__