summaryrefslogtreecommitdiff
path: root/libc/stdlib/malloc
AgeCommit message (Collapse)Author
2003-09-17Make sure static heaps are aligned correctly.Miles Bader
2003-09-06'extern inline' doesn't work... Use 'static inline'Eric Andersen
2003-09-06add missing prototypeEric Andersen
2003-09-06Fix errno values. Fix MALLOC_GLIBC_COMPAT handling in malloc/malloc.c,Eric Andersen
which was reversed. Provide more consistancy between implementations. Handle it when people do stupid things like malloc(-1);
2003-08-08Add in a MALLOC_GLIBC_COMPAT option to let people decide if theyEric Andersen
want glibc style malloc(0) behavior
2003-04-02(free_to_heap): Unlock the heap before returning in theMiles Bader
__UCLIBC_UCLINUX_BROKEN_MUNMAP__ case. Fix from YYang1@Winbond.com.tw.
2003-01-23Update malloc behavior on malloc(0) to be consistant withEric Andersen
malloc-930716 behavior, i.e. return a NULL.
2002-11-21Debugging tweaks.Miles Bader
2002-11-21Improve malloc debugging support.Miles Bader
2002-10-18Don't infinitely recurse when trying to grow __malloc_mmb_heap.Miles Bader
2002-10-17Fix malloc so it compiles and works when using pthreadsEric Andersen
-Erik
2002-10-15Use __heap_[un]lock instead of __malloc_[un]lock.Miles Bader
2002-10-15Get rid of old malloc lock stuff.Miles Bader
2002-10-15Fix locking to not deadlock when __UCLIBC_UCLINUX_BROKEN_MUNMAP__ is defined.Miles Bader
2002-10-09* Add support for uClinux's broken munmap, contingent onMiles Bader
__UCLIBC_UCLINUX_BROKEN_MUNMAP__ (which is currently not defined anywhere). This makes other cases a tiny bit less efficient too. * Move the malloc lock into the heap structure (locking is still done at the malloc level though, not by the heap functions). * Initialize the malloc heap to contain a tiny initial static free-area so that programs that only do a very little allocation won't ever call mmap.
2002-09-13(__heap_check_failure): New function.Miles Bader
(__heap_check): Add more checks. Use `__heap_check_failure'.
2002-09-09(realloc): Record the correct size in the malloc header in the caseMiles Bader
where we extended the existing allocation, and got back more than we asked for from the heap.
2002-09-06Initial checkin.Miles Bader
2002-09-06Update debugging hooks.Miles Bader
2002-09-04(free):Miles Bader
Update debug statement. Update to use __heap_delete and __heap_is_empty.
2002-09-04(__heap_delete): Renamed from `__heap_unlink_free_area'.Miles Bader
(__heap_free_area_alloc): Use __heap_delete. (__heap_is_empty): New macro.
2002-08-30Doc fix.Miles Bader
2002-08-30(__heap_free): Tighten up the inner loop, and make the code more readable.Miles Bader
2002-08-30Use `likely' & `unlikely' instead of the `__malloc_'-prefixed versions.Miles Bader
2002-08-30(likely, unlikely): New macros.Miles Bader
2002-08-30(likely, unlikely): New macros.Miles Bader
(__malloc_likely, __malloc_unlikely): Macros removed.
2002-08-19(CSRC): Make contents source files, not object files.Miles Bader
2002-08-19(CSRC): Add `memalign.c'.Miles Bader
2002-08-19Initial checkin.Miles Bader
2002-08-19(realloc): Follow new arg conventions of MALLOC_SET_SIZE.Miles Bader
2002-08-19(malloc): Use MALLOC_SETUP.Miles Bader
2002-08-19(MALLOC_SETUP): New macro.Miles Bader
(MALLOC_SET_SIZE): Take the base-address of the block, not the user-address. (MALLOC_ADDR): Macro removed.
2002-08-14Use __malloc_unlikely instead of `likely'.Miles Bader
2002-08-14Add flow-control hints with __malloc_likely and __malloc_unlikely.Miles Bader
2002-08-14(__malloc_likely, __malloc_unlikely): New macros.Miles Bader
2002-08-14Handle zero NEW_SIZE case.Miles Bader
2002-08-13Use `return' for null pointers, to avoid a giant block holding the restMiles Bader
of the function.
2002-08-07Per suggestion from Miles Bader, move calloc.c to libc/stdlib.Eric Andersen
Also, Manuel notices that I forgot to check for when nmemb=0, which would result in a segfault, so fix that case as well. -Erik
2002-08-06Unify calloc (its the same thing regardless of the underlyingEric Andersen
malloc implementation). Fix problem reported to bugtraq about problems with integer overflow that can occur during the computation of the memory region size by calloc (and similar functions) which could result in a subsequent buffer overflow. -Erik
2002-08-01Use MALLOC_REALLOC_MIN_FREE_SIZE.Miles Bader
2002-08-01(MALLOC_REALLOC_MIN_FREE_SIZE): New macro.Miles Bader
Enable debugging if MALLOC_DEBUGGING is defined.
2002-08-01(HEAP_MIN_SIZE): New macro.Miles Bader
(HEAP_MIN_FREE_AREA_SIZE): Increase size. Enable debugging if HEAP_DEBUGGING is defined.
2002-07-31In the allocate-and-copy case, don't include the malloc header in ourMiles Bader
size calculations.
2002-07-31Update debugging printfs.Miles Bader
2002-07-31Account for MALLOC_HEADER_SIZE when calculating new size.Miles Bader
2002-07-31Use MALLOC_HEADER_SIZE.Miles Bader
2002-07-31(MALLOC_HEADER_SIZE): New macro.Miles Bader
(MALLOC_BASE, MALLOC_ADDR): Use it.
2002-07-30Make sure NEW_SIZE is a multiple of HEAP_GRANULARITY.Miles Bader
Calculate amount freed when shrinking correctly.
2002-07-30Update the size of grown/shrunk allocations.Miles Bader
MALLOC_SET_SIZE now takes the user-address rather than the base-address.
2002-07-30MALLOC_SET_SIZE now takes the user-address rather than the base-address.Miles Bader