Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | whitespace fixes | otto | 2017-04-17 | 1 | -14/+14 | |
| | ||||||
* | allow clearing less than allocated and document freezero(3) better | otto | 2017-04-13 | 1 | -5/+5 | |
| | ||||||
* | Introducing freezero(3) a version of free that guarantees the process | otto | 2017-04-10 | 1 | -12/+72 | |
| | | | | | | no longer has access to the content of a memmory object. It does this by either clearing (if the object memory remains cached) or by calling munmap(2). ok millert@, deraadt@, guenther@ | |||||
* | first print size in meta-data then supplied arg size when an inconsistency is | otto | 2017-04-06 | 1 | -3/+3 | |
| | | | | detected wrt recallocarray() | |||||
* | small cleanup & optimization; ok deraadt@ millert@ | otto | 2017-03-28 | 1 | -2/+5 | |
| | ||||||
* | add a helper function to print all pools #ifdef MALLOC_STATS | otto | 2017-03-24 | 1 | -1/+16 | |
| | | | | from David CARLIER | |||||
* | move recallocarray to malloc.c and | otto | 2017-03-24 | 1 | -17/+206 | |
| | | | | | | | - use internal meta-data to do more consistency checking (especially with option C) - use cheap free if possible ok deraadt@ | |||||
* | Add a NULL test to wrterror() to avoid a NULL deref when called from a | jsg | 2017-02-15 | 1 | -2/+2 | |
| | | | | | | free() error path. ok otto@ | |||||
* | fix a comment and rm some dead code as a result of the previous diff | otto | 2017-02-02 | 1 | -8/+5 | |
| | ||||||
* | Let realloc handle and produce moved pointers for allocations betweenlibressl-v2.5.1 | otto | 2017-02-01 | 1 | -20/+37 | |
| | | | | half a page and a page. ok jmatthew@ tb@ | |||||
* | 1. When shrinking a chunk allocation, compare the size of the current | otto | 2017-01-21 | 1 | -46/+87 | |
| | | | | | | | | | | allocation to the size of the new allocation (instead of the requested size). 2. Previously realloc takes the easy way and always reallocates if C is active. This commit fixes by carefully updating the recorded requested size in all cases, and writing the canary bytes in the proper location after reallocating. 3. Introduce defines to test if MALLOC_MOVE should be done and to compute the new value. | |||||
* | MALLOC_STATS tweaks, by default not compiled in | otto | 2016-11-04 | 1 | -13/+29 | |
| | ||||||
* | small tweak to also check canaries if F is in effect | otto | 2016-11-03 | 1 | -3/+5 | |
| | ||||||
* | remove some old option letters and also make P non-settable. It has | otto | 2016-10-31 | 1 | -24/+6 | |
| | | | | | been the default for ages, and I see no valid reason to be able to disable it. ok natano@ | |||||
* | Pages in the malloc cache are either reused quickly or unmapped | otto | 2016-10-28 | 1 | -14/+1 | |
| | | | | | | quickly. In both cases it does not make sense to set hints on them. So remove that option, which is just a remainder of old times when malloc used to hold on to pages. ok stefan@ | |||||
* | - fix MALLOC_STATS compile | otto | 2016-10-22 | 1 | -3/+6 | |
| | | | | - redundant cast is redundant | |||||
* | fix some void * arithmetic by casting | otto | 2016-10-21 | 1 | -4/+4 | |
| | ||||||
* | and recommit with fixed GC | otto | 2016-10-21 | 1 | -103/+112 | |
| | ||||||
* | backout for now; flag combination GC is not ok | otto | 2016-10-20 | 1 | -110/+103 | |
| | ||||||
* | Also place canaries in > page sized objects (if C is in effect); ok tb@ | otto | 2016-10-20 | 1 | -103/+110 | |
| | ||||||
* | Wrap _malloc_init() so internal calls go directly | guenther | 2016-10-15 | 1 | -1/+2 | |
| | | | | | prodded by otto@ ok kettenis@ otto@ | |||||
* | 0xd0 -> 0xdb; ok deraadt@ millert@ tedu@ | otto | 2016-10-14 | 1 | -3/+3 | |
| | ||||||
* | optimize canary code a bit by storing offset of sizes table instead of | otto | 2016-10-12 | 1 | -5/+7 | |
| | | | | recomputing it all the time | |||||
* | stray tab | otto | 2016-10-07 | 1 | -2/+2 | |
| | ||||||
* | Beter implementation of chunk canaries: store size in chunk meta data | otto | 2016-10-07 | 1 | -61/+63 | |
| | | | | instead of chunk itself; does not change actual allocated size; ok tedu@ | |||||
* | Delete casts to off_t and size_t that are implied by assignments | guenther | 2016-09-21 | 1 | -7/+7 | |
| | | | | | | | or prototypes. Ditto for some of the char* and void* casts too. verified no change to instructions on ILP32 (i386) and LP64 (amd64) ok natano@ abluhm@ deraadt@ millert@ | |||||
* | move page junking tp unmap(), right before we stick the region in the cache; | otto | 2016-09-18 | 1 | -6/+6 | |
| | | | | ok tedu@ | |||||
* | Less lock contention by using more pools for mult-threaded programs. | otto | 2016-09-01 | 1 | -85/+178 | |
| | | | | tested by many (thanks!) ok tedu, guenther@ | |||||
* | black magic for sparc page size can go | tedu | 2016-09-01 | 1 | -4/+2 | |
| | ||||||
* | wrterror() is fatal, delete dead code; ok tom@ natano@ tedu@ | otto | 2016-08-17 | 1 | -61/+22 | |
| | ||||||
* | J/j is a three valued option, document and fix code to actuall support that | otto | 2016-07-06 | 1 | -3/+5 | |
| | | | | | with a little help from jmc@ for the man page bits ok jca@ and a reluctant tedu@ | |||||
* | adapt S option: add C, rm F (not relevant with 0 cache and disables | otto | 2016-06-30 | 1 | -3/+3 | |
| | | | | chunk rnd), rm P: is default | |||||
* | Back out previous; otto saw a potential race that could lead to a | tb | 2016-06-28 | 1 | -32/+23 | |
| | | | | | | double unmap and I experienced a much more unstable firefox. discussed with otto on icb | |||||
* | defer munmap to after unlocking malloc. this can (unfortunately) be an | tedu | 2016-06-27 | 1 | -23/+32 | |
| | | | | | | | expensive syscall, and we don't want to tie up other threads. there's no need to hold the lock, so defer it to afterwards. from Michael McConville ok deraadt | |||||
* | two times a define to an inline function, from Michael McConville; ok djm@ | otto | 2016-04-12 | 1 | -10/+19 | |
| | ||||||
* | tweak MALLOC_STATS printing (switched off by default), prodded by | otto | 2016-04-09 | 1 | -14/+14 | |
| | | | | Michael McConville | |||||
* | redundant memset(3), from Michael McConville, ok armani@ | otto | 2016-04-09 | 1 | -2/+1 | |
| | ||||||
* | properly guard to macros | mmcc | 2016-03-17 | 1 | -5/+5 | |
| | | | | ok otto@ | |||||
* | small step towards multiple pools: move two globls into the struct dir_info | otto | 2016-03-14 | 1 | -112/+126 | |
| | | | | ok @stefan armani@ | |||||
* | environ and __progname are not declared in a public header; declare them | guenther | 2016-03-13 | 1 | -3/+1 | |
| | | | | | | in libc's hidden/stdlib.h instead of in each .c file that needs one ok deraadt@ gsoares@ mpi@ | |||||
* | refactor option letter parsing into a subfunction, to increase clarity | deraadt | 2016-02-25 | 1 | -93/+102 | |
| | | | | | about which options are turned on/off by 's' and 'S' ok tedu | |||||
* | Don't crash dumping malloc stats if malloc_init hasn't been called, noted by | otto | 2016-01-26 | 1 | -1/+3 | |
| | | | | David CARLIER | |||||
* | Long ago, malloc internally had two kinds of failures, warnings and errors. | tedu | 2016-01-06 | 1 | -8/+4 | |
| | | | | | | | | The 'A' option elevated warnings to errors, and has been the default for some time. Then warnings were effectively eliminated in favor of everything being an error, but then the 'a' flag turned real errors into warnings! Remove the 'a' option entirely. You shouldn't have used it anyway. ok tb tdeval | |||||
* | another case where bad things would happen after wrterror | tedu | 2015-12-30 | 1 | -2/+4 | |
| | ||||||
* | if somebody makes the mistake of disabling abort, don't deref null in | tedu | 2015-12-30 | 1 | -2/+4 | |
| | | | | validate_junk. from Michal Mazurek | |||||
* | Integrate two patches originally from Daniel Micay. | tedu | 2015-12-09 | 1 | -8/+76 | |
| | | | | | | | | | | | | 1. Optionally add random "canaries" to the end of an allocation. This requires increasing the internal size of the allocation slightly, which probably results in a large effective increase with current power of two sizing. Therefore, this option is only enabled via 'C'. 2. When writing junk (0xdf) to freed chunks (current default behavior), check that the junk is still intact when finally freeing the delayed chunk to catch some potential use after free. This should be pretty cheap so there's no option to control it separately. ok deraadt tb | |||||
* | For now, permit overriding of the malloc family, to make emacs happy | guenther | 2015-09-13 | 1 | -6/+6 | |
| | ||||||
* | Wrap <stdlib.h> so that calls go direct and the symbols not in the | guenther | 2015-09-13 | 1 | -1/+8 | |
| | | | | | | C standard are all weak. Apply __{BEGIN,END}_HIDDEN_DECLS to gdtoa{,imp}.h, hiding the arch-specific __strtorx, __ULtox_D2A, __strtorQ, __ULtoQ_D2A symbols. | |||||
* | improve realloc. when expanding a region, actually use the free page cache | tedu | 2015-04-06 | 1 | -7/+16 | |
| | | | | | instead of simply zapping it. this can save many syscalls in a program that repeatedly grows and shrinks a buffer, as observed in the wild. | |||||
* | Move to the <limits.h> universe. | deraadt | 2015-01-16 | 1 | -2/+2 | |
| | | | | review by millert, binary checking process with doug, concept with guenther |