Răsfoiți Sursa

MALLOC_SET_SIZE now takes the user-address rather than the base-address.

Miles Bader 23 ani în urmă
părinte
comite
906ffafd8b
1 a modificat fișierele cu 1 adăugiri și 2 ștergeri
  1. 1 2
      libc/stdlib/malloc/malloc.c

+ 1 - 2
libc/stdlib/malloc/malloc.c

@@ -121,9 +121,8 @@ malloc (size_t size)
   if (mem)
     /* Record the size of this block.  */
     {
-      MALLOC_SET_SIZE (mem, size);
-
       mem = MALLOC_ADDR (mem);
+      MALLOC_SET_SIZE (mem, size);
 
       MALLOC_DEBUG ("  malloc: returning 0x%lx (base:0x%lx, total_size:%d)\n",
 		    (long)mem, (long)mem - MALLOC_ALIGNMENT, size);