summaryrefslogtreecommitdiffstats
path: root/libc/stdlib/malloc/realloc.c
Commit message (Collapse)AuthorAgeFilesLines
* malloc: handle size overflows in realloc()Mike Frysinger2009-10-161-0/+3
| | | | | | | | | | The malloc() code checks the incoming size to make sure the header adjustment doesn't cause overflow in the size storage. Add the same check to realloc() to catch stupid stuff like realloc(..., -1). Reported-by: James Coleman <james.coleman@ubicom.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* trim Experimentally off and uncommented hiddenAustin Foxley2009-09-181-1/+0
| | | | | | | | sed -i -e '/Experimentally off - /d' $(grep -rl "Experimentally off - " *) sed -i -e '/^\/\*[[:space:]]*libc_hidden_proto(/d' $(grep -rl "libc_hidden_proto" *) should be a nop Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
* Synch with trunk @ 24075.Carmelo Amoroso2008-11-171-4/+4
| | | | Step 7: libc/stdlib and malloc
* BIG BIG commit: all left files merged from trunk [rev 22714]. Currenntly ↵Carmelo Amoroso2008-07-091-1/+1
| | | | NPTL sh4 port build and work fine. All committed to allow Khem Ray working on a working branch to integrate the ARM nptl port. MIPS nptl port not tested but should still building and working fine. There are some other part non yet merged with trunk (misc/internals and some headers file that need some more work). Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* Fix Makefile.in and synch them with trunk. Signed-off-by: Carmelo Amoroso ↵Carmelo Amoroso2007-11-201-1/+6
| | | | <carmelo.amoroso@st.com>
* Merge from trunk. Going pretty good so far. Kind of. Okay, not really."Steven J. Hill"2006-02-251-3/+5
|
* Merge from trunk."Steven J. Hill"2005-12-021-1/+1
|
* Code formatting cleanup.Miles Bader2003-10-161-5/+6
|
* Fix errno values. Fix MALLOC_GLIBC_COMPAT handling in malloc/malloc.c,Eric Andersen2003-09-061-6/+6
| | | | | which was reversed. Provide more consistancy between implementations. Handle it when people do stupid things like malloc(-1);
* Improve malloc debugging support.Miles Bader2002-11-211-3/+4
|
* Fix malloc so it compiles and works when using pthreadsEric Andersen2002-10-171-4/+4
| | | | -Erik
* Use __heap_[un]lock instead of __malloc_[un]lock.Miles Bader2002-10-151-4/+4
|
* (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.
* (realloc): Follow new arg conventions of MALLOC_SET_SIZE.Miles Bader2002-08-191-2/+2
|
* Handle zero NEW_SIZE case.Miles Bader2002-08-141-45/+54
|
* Use MALLOC_REALLOC_MIN_FREE_SIZE.Miles Bader2002-08-011-1/+1
|
* In the allocate-and-copy case, don't include the malloc header in ourMiles Bader2002-07-311-2/+2
| | | | size calculations.
* Update debugging printfs.Miles Bader2002-07-311-1/+1
|
* Account for MALLOC_HEADER_SIZE when calculating new size.Miles Bader2002-07-311-3/+4
|
* Make sure NEW_SIZE is a multiple of HEAP_GRANULARITY.Miles Bader2002-07-301-2/+2
| | | | Calculate amount freed when shrinking correctly.
* Update the size of grown/shrunk allocations.Miles Bader2002-07-301-16/+16
| | | | MALLOC_SET_SIZE now takes the user-address rather than the base-address.
* Implement shrinking.Miles Bader2002-07-301-6/+19
| | | | | Fix bug when growing an allocation. Use new malloc header macros.
* Redo the locking, so that it may actually work. Now locking is done atMiles Bader2002-07-251-0/+3
| | | | | | | | | the malloc/free level, not within the heap abstraction, and there's a separate lock to control sbrk access. Also, get rid of the separate `unmap_free_area' function in free.c, and just put the code in the `free' function directly, which saves a bunch of space (even compared to using an inline function) for some reason.
* Misc small cleanups.Miles Bader2002-07-241-2/+2
|
* * Automatically try to unmap heap free-areas when they get very big.Miles Bader2002-07-231-15/+2
| | | | | | | | * Instead of using mmap/munmap directly for large allocations, just use the heap for everything (this is reasonable now that heap memory can be unmapped). * Use sbrk instead of mmap/munmap on systems with an MMU.
* Doc fix.Miles Bader2002-07-191-1/+1
|
* Miles Bader implemented a new mmap based malloc which is muchEric Andersen2002-07-181-0/+76
smarter than the old "malloc-simple", and actually works, unlike the old "malloc". So kill the old "malloc-simple" and the old "malloc" and replace them with Miles' new malloc implementation. Update Config files to match. Thanks Miles!