summaryrefslogtreecommitdiffstats
path: root/libc/stdlib/malloc
Commit message (Collapse)AuthorAgeFilesLines
...
* The variable used to store pagesize is not the same as theEric Andersen2004-08-161-1/+2
| | | | | _dl_pagesize variable in ldso, so avoid aliasing. -Erik
* Fixup PAGE_SIZE problemsEric Andersen2004-08-131-3/+2
| | | | -Erik
* Use MAP_PRIVATE whenever __ARCH_HAS_MMU__ is set.Eric Andersen2004-07-151-1/+6
| | | | Only use MAP_SHARED when mmu-less.
* s/UCLIBC_HAS_MMU/ARCH_HAS_MMU/gEric Andersen2004-01-161-1/+1
|
* Rework malloc. The new default implementation is based on dlmalloc from DougEric Andersen2003-12-302-2/+42
| | | | | | | 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
* Fix a long-standing bug with pthreads. A couple of linuxthreads filesManuel Novoa III2003-12-272-4/+4
| | | | | | | | | | | | | | | | 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.
* Peter Kjellerstedt writes:Eric Andersen2003-10-181-1/+1
| | | | | | | 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).
* Code formatting cleanup.Miles Bader2003-10-161-5/+6
|
* Don't set errno if for zero SIZE returns.Miles Bader2003-10-161-11/+14
| | | | Code formatting cleanup.
* More fiddling with static free-areas: make sure both their size _and_Miles Bader2003-09-221-5/+5
| | | | their alignment are correct.
* Make sure we don't allocate too little space for static free-areasMiles Bader2003-09-191-1/+3
| | | | because of our fiddling with alignment (because doing so is VERY BAD).
* Add dependencies on header files.Miles Bader2003-09-191-2/+5
|
* Make sure static heaps are aligned correctly.Miles Bader2003-09-171-9/+11
|
* 'extern inline' doesn't work... Use 'static inline'Eric Andersen2003-09-061-5/+5
|
* add missing prototypeEric Andersen2003-09-061-0/+2
|
* Fix errno values. Fix MALLOC_GLIBC_COMPAT handling in malloc/malloc.c,Eric Andersen2003-09-062-12/+24
| | | | | which was reversed. Provide more consistancy between implementations. Handle it when people do stupid things like malloc(-1);
* Add in a MALLOC_GLIBC_COMPAT option to let people decide if theyEric Andersen2003-08-081-0/+5
| | | | want glibc style malloc(0) behavior
* (free_to_heap): Unlock the heap before returning in theMiles Bader2003-04-021-2/+5
| | | | __UCLIBC_UCLINUX_BROKEN_MUNMAP__ case. Fix from YYang1@Winbond.com.tw.
* Update malloc behavior on malloc(0) to be consistant withEric Andersen2003-01-231-2/+5
| | | | malloc-930716 behavior, i.e. return a NULL.
* Debugging tweaks.Miles Bader2002-11-212-8/+12
|
* Improve malloc debugging support.Miles Bader2002-11-217-46/+186
|
* Don't infinitely recurse when trying to grow __malloc_mmb_heap.Miles Bader2002-10-181-18/+19
|
* Fix malloc so it compiles and works when using pthreadsEric Andersen2002-10-172-5/+5
| | | | -Erik
* Use __heap_[un]lock instead of __malloc_[un]lock.Miles Bader2002-10-151-4/+4
|
* Get rid of old malloc lock stuff.Miles Bader2002-10-151-8/+0
|
* Fix locking to not deadlock when __UCLIBC_UCLINUX_BROKEN_MUNMAP__ is defined.Miles Bader2002-10-152-34/+32
|
* * Add support for uClinux's broken munmap, contingent onMiles Bader2002-10-094-29/+264
| | | | | | | | | __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.
* (__heap_check_failure): New function.Miles Bader2002-09-131-16/+67
| | | | (__heap_check): Add more checks. Use `__heap_check_failure'.
* (realloc): Record the correct size in the malloc header in the caseMiles Bader2002-09-091-1/+1
| | | | | where we extended the existing allocation, and got back more than we asked for from the heap.
* Initial checkin.Miles Bader2002-09-061-0/+86
|
* Update debugging hooks.Miles Bader2002-09-063-30/+20
|
* (free):Miles Bader2002-09-041-5/+5
| | | | | Update debug statement. Update to use __heap_delete and __heap_is_empty.
* (__heap_delete): Renamed from `__heap_unlink_free_area'.Miles Bader2002-09-041-3/+6
| | | | | (__heap_free_area_alloc): Use __heap_delete. (__heap_is_empty): New macro.
* Doc fix.Miles Bader2002-08-301-1/+1
|
* (__heap_free): Tighten up the inner loop, and make the code more readable.Miles Bader2002-08-301-29/+24
|
* Use `likely' & `unlikely' instead of the `__malloc_'-prefixed versions.Miles Bader2002-08-302-5/+5
|
* (likely, unlikely): New macros.Miles Bader2002-08-301-0/+12
|
* (likely, unlikely): New macros.Miles Bader2002-08-301-6/+8
| | | | (__malloc_likely, __malloc_unlikely): Macros removed.
* (CSRC): Make contents source files, not object files.Miles Bader2002-08-191-2/+2
|
* (CSRC): Add `memalign.c'.Miles Bader2002-08-191-2/+2
|
* Initial checkin.Miles Bader2002-08-191-0/+94
|
* (realloc): Follow new arg conventions of MALLOC_SET_SIZE.Miles Bader2002-08-191-2/+2
|
* (malloc): Use MALLOC_SETUP.Miles Bader2002-08-191-3/+2
|
* (MALLOC_SETUP): New macro.Miles Bader2002-08-191-5/+6
| | | | | (MALLOC_SET_SIZE): Take the base-address of the block, not the user-address. (MALLOC_ADDR): Macro removed.
* Use __malloc_unlikely instead of `likely'.Miles Bader2002-08-141-1/+4
|
* Add flow-control hints with __malloc_likely and __malloc_unlikely.Miles Bader2002-08-141-5/+7
|
* (__malloc_likely, __malloc_unlikely): New macros.Miles Bader2002-08-141-0/+10
|
* Handle zero NEW_SIZE case.Miles Bader2002-08-141-45/+54
|
* Use `return' for null pointers, to avoid a giant block holding the restMiles Bader2002-08-131-95/+95
| | | | of the function.
* Per suggestion from Miles Bader, move calloc.c to libc/stdlib.Eric Andersen2002-08-071-1/+2
| | | | | | 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