Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | When system calls indicate an error they return -1, not some arbitrary | deraadt | 2019-06-28 | 1 | -2/+2 |
| | | | | | | value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future. | ||||
* | Only override size of chunk if we're not given the actual length. | otto | 2019-05-23 | 1 | -2/+3 |
| | | | | Fixes malloc_conceal...freezero with malloc options C and/or G. | ||||
* | Inroduce malloc_conceal() and calloc_conceal(). Similar to their | otto | 2019-05-10 | 1 | -196/+193 |
| | | | | | counterparts but return memory in pages marked MAP_CONCEAL and on free() freezero() is actually called. | ||||
* | Move default numer of pools in the multi-threaded case to 8. Various tests | otto | 2019-01-10 | 1 | -2/+2 |
| | | | | by me and others indicate that it is the optimum. | ||||
* | Make the "not my pool" searching loop a tiny bit smarter, while | otto | 2019-01-10 | 1 | -20/+37 |
| | | | | | | making the number of pools variable. Do not document the malloc conf settings atm, don't know yet if they will stay. Thanks to all the testers. ok deraadt@ | ||||
* | Improve speed for the multi-threaded case by reducing lock contention. | otto | 2018-12-10 | 1 | -30/+21 |
| | | | | tested by many; ok florian@ | ||||
* | style; OK otto | florian | 2018-12-09 | 1 | -3/+3 |
| | |||||
* | Refactor "find the right pool" code into a function. ok djm@ tb@ | otto | 2018-11-27 | 1 | -65/+34 |
| | |||||
* | Introducing malloc_usable_size() was a mistake. While some other | otto | 2018-11-21 | 1 | -78/+1 |
| | | | | | | | | | | | libs have it, it is a function that is considered harmful, so: Delete malloc_usable_size(). It is a function that blurs the line between malloc managed memory and application managed memory and exposes some of the internal workings of malloc. If an application relies on that, it is likely to break using another implementation of malloc. If you want usable size x, just allocate x bytes. ok deraadt@ and other devs | ||||
* | Fix compilation on alpha, where DEF_WEAK() really must be paired with | guenther | 2018-11-19 | 1 | -2/+1 |
| | | | | PROTO_NORMAL(). Problem noted by deraadt@ | ||||
* | Implement malloc_usable_size(); ok millert@ deraadt@ and jmc@ for the man page | otto | 2018-11-18 | 1 | -1/+79 |
| | |||||
* | Use the new vm.malloc_conf sysctl; ok millert@ deraadt@ | otto | 2018-11-06 | 1 | -6/+11 |
| | |||||
* | Implement C11's aligned_alloc(3). ok guenther@ | otto | 2018-11-05 | 1 | -1/+43 |
| | |||||
* | sys/uio.h is not used anymore | otto | 2018-04-07 | 1 | -3/+2 |
| | |||||
* | fix MALLOC_STATS; spotted by and ok semarie@ | otto | 2018-03-30 | 1 | -1/+5 |
| | |||||
* | use _ALIGN() which is uhm a bit OpenBSD-specific, but it means we | deraadt | 2018-03-06 | 1 | -3/+2 |
| | | | | | | don't need to use sys/param.h at all, guess which one i believe is greater namespace polution ok otto | ||||
* | Use _MAX_PAGE_SHIFT, rather than #ifdef mips64 | deraadt | 2018-03-05 | 1 | -6/+2 |
| | | | | ok guenther kettenis | ||||
* | use consistent style for for loop in unmap(), no functional change | otto | 2018-02-07 | 1 | -4/+2 |
| | |||||
* | keep in sync with ld.so malloc.c | otto | 2018-01-30 | 1 | -2/+3 |
| | |||||
* | - An error in the multithreaded case could print the wrong function name | otto | 2018-01-28 | 1 | -12/+23 |
| | | | | | | | - Start with a full page of struct region_info's - Save an mprotect in the init code: allocate 3 pages with none and make the middle page r/w instead of a r/w allocation and two calls to make the guard pages none | ||||
* | - do not junk pages returned by free_bytes(), all freed chunks are already | otto | 2018-01-26 | 1 | -19/+19 |
| | | | | | junked - freezero(): only clear requested size | ||||
* | Zap the rotor, it was a wrong idea. Cluebat applied by kshe who | otto | 2018-01-18 | 1 | -6/+3 |
| | | | | | came also up with this diff. Simple, no bias and benchmarks show the extra random calls disappear in te measurement noise. | ||||
* | Move to ffs(3) for bitmask scanning. I played with this earlier, | otto | 2018-01-18 | 1 | -21/+11 |
| | | | | | | | but at that time ffs function calls were generated instead of the compiler inlining the code. Now that ffs is marked protected in libc this is handled better. Thanks to kshe who prompted me to look at this again. | ||||
* | optimization and some cleanup; mostly from kshe (except the unmap() part) | otto | 2018-01-08 | 1 | -67/+51 |
| | |||||
* | Only init chunk_info once, plus some moving of code to group related functions. | otto | 2018-01-01 | 1 | -273/+267 |
| | |||||
* | step one in avoiding unneccesary init of chunk_info; | otto | 2017-12-27 | 1 | -65/+81 |
| | | | | some cleanup; tested by sthen@ on a ports build | ||||
* | 's' should include 'f'; from Jacqueline Jolicoeur | otto | 2017-11-02 | 1 | -2/+2 |
| | |||||
* | Restore a return that was inadvertently removed from freezero() in r1.234, | jsing | 2017-10-19 | 1 | -1/+2 |
| | | | | | | | which results in an internal double free when internal functions are not in use. ok otto@ | ||||
* | do not return f() where f is a void function; loop var type fix | otto | 2017-10-05 | 1 | -4/+5 |
| | |||||
* | Use dprintf instead of snprintf/write | otto | 2017-10-05 | 1 | -82/+36 |
| | |||||
* | Make delayed free non-optional and make F do an extensive double free check. | otto | 2017-09-23 | 1 | -21/+26 |
| | | | | ok tb@ tedu@ | ||||
* | mapalign returns MAP_FAILED for failuer; from George Koehler | otto | 2017-09-12 | 1 | -2/+2 |
| | |||||
* | check double free before canary for chunks; ok millert@ | otto | 2017-09-11 | 1 | -5/+5 |
| | |||||
* | two MALLOC_STATS only tweaks; one from David CARLIER, the other found by clang | otto | 2017-08-20 | 1 | -8/+4 |
| | |||||
* | one more instance of the previous commit; also initialize ->offset to a | otto | 2017-07-10 | 1 | -2/+3 |
| | | | | definite value in the size == 0 case | ||||
* | Only access offset if canaries are enabled *and* size > 0, otherwise offset | otto | 2017-07-07 | 1 | -2/+2 |
| | | | | is not initialized. Problem spotted by Carlin Bingham; ok phessler@ tedu@ | ||||
* | port the RBT code to userland by making it part of libc. | dlg | 2017-06-19 | 1 | -10/+11 |
| | | | | | | | | | | | | | | src/lib/libc/gen/tree.c is a copy of src/sys/kern/subr_tree.c, but with annotations for symbol visibility. changes to one should be reflected in the other. the malloc debug code that uses RB code is ported to RBT. because libc provides the RBT code, procmap doesn't have to reach into the kernel and build subr_tree.c itself now. mild enthusiasm from many ok guenther@ | ||||
* | - fix bug wrt posix_memalign(3) of blocks between half a page and a page | otto | 2017-05-13 | 1 | -4/+9 |
| | | | | | - document posix_memalign() does not play nice with reacallocarray(3) and freezero(3) | ||||
* | For small allocations (chunk) freezero only validates the given | otto | 2017-04-22 | 1 | -5/+10 |
| | | | | | | | | size if canaries are enabled. In that case we have the exact requested size of the allocation. But we can at least check the given size against the chunk size if C is not enabled. Plus add some braces so my brain doesn't have to scan for dangling else problems when I see this code. | ||||
* | don't forget to fill in canary bytes for posix_memalign(3); reported by | otto | 2017-04-18 | 1 | -1/+4 |
| | | | | and ok jeremy@ | ||||
* | 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@ |