summaryrefslogtreecommitdiff
path: root/libc/stdlib/malloc
AgeCommit message (Collapse)Author
2004-07-15Use MAP_PRIVATE whenever __ARCH_HAS_MMU__ is set.Eric Andersen
Only use MAP_SHARED when mmu-less.
2004-01-16s/UCLIBC_HAS_MMU/ARCH_HAS_MMU/gEric Andersen
2003-12-30Rework malloc. The new default implementation is based on dlmalloc from DougEric Andersen
Lea. It is about 2x faster than the old malloc-930716, and behave itself much better -- it will properly release memory back to the system, and it uses a combination of brk() for small allocations and mmap() for larger allocations. -Erik
2003-12-27Fix a long-standing bug with pthreads. A couple of linuxthreads filesManuel Novoa III
were including libc-lock.h which had a bunch of weak pragmas. Also, uClibc supplied a number of no-op weak thread functions even though many weren't needed. This combined result was that sometimes the functional versions of thread functions in pthread would not override the weaks in libc. While fixing this, I also prepended double-underscore to all necessary weak thread funcs in uClibc, and removed all unused weaks. I did a test build, but haven't tested this since these changes are a backport from my working tree. I did test the changes there and no longer need to explicitly add -lpthread in the perl build for perl to pass its thread self tests.
2003-10-18Peter Kjellerstedt writes:Eric Andersen
rm.patch: * Define $(RM) as rm -f in Rules.mak and test/Rules.mak (this is the same definition as gmake uses by default). * Change all occurrences of rm and rm -f into $(RM).
2003-10-16Code formatting cleanup.Miles Bader
2003-10-16Don't set errno if for zero SIZE returns.Miles Bader
Code formatting cleanup.
2003-09-22More fiddling with static free-areas: make sure both their size _and_Miles Bader
their alignment are correct.
2003-09-19Make sure we don't allocate too little space for static free-areasMiles Bader
because of our fiddling with alignment (because doing so is VERY BAD).
2003-09-19Add dependencies on header files.Miles Bader
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