Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | 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 | |
| | ||||||
* | word fix; from edgar pettijohn | jmc | 2018-01-30 | 1 | -3/+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 | |||||
* | Fix one possible buffer overflow and one underflow. Also some minor | millert | 2017-12-24 | 1 | -20/+36 | |
| | | | | cleanups. From Jan Kokemueller. OK deraadt@ | |||||
* | Move __cxa_thread_atexit* to its own .c file to avoid pulling the code | guenther | 2017-12-16 | 4 | -39/+64 | |
| | | | | | | | (w/ _dlctl reference) into static executables. It's all Mark's code so put his preferred copyright on it. ok kettenis@ | |||||
* | Remove DEF_STRONG(__cxa_thread_atexit_impl). This produces an unwanted | kettenis | 2017-12-05 | 1 | -2/+1 | |
| | | | | | _libc___cxa_thread_atexit_impl reference on gcc architectures that breaks the build. | |||||
* | Implement __cxa_thread_atexit to support C++11 thread_local scope. The | kettenis | 2017-12-05 | 2 | -2/+56 | |
| | | | | | | | interface is also made available as __cxa_thread_atexit_impl to satisfy the needs of GNU libstdc++. ok guenther@, millert@ | |||||
* | GNU ld has prefixed the contents of .gnu.warning.SYMBOL sections | tb | 2017-11-28 | 2 | -5/+5 | |
| | | | | | | | | with "warning: " since 2003, so the messages themselves need not contain the prefix anymore. From Scott Cheloha ok jca, deraadt | |||||
* | '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 | |
| | ||||||
* | Minimize #includes, particularly to avoid thread_private.h | guenther | 2017-08-12 | 2 | -7/+3 | |
| | | | | ok tedu@ | |||||
* | add missing and correct misspelled names, most in NAME sections; | schwarze | 2017-08-01 | 2 | -6/+8 | |
| | | | | | found with regress/usr.bin/mandoc/db/dbm_dump; OK jmc@ | |||||
* | 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@ | |||||
* | The 0x (or 0X) prefix in base 16 is optional so only skip over the | millert | 2017-07-06 | 6 | -18/+18 | |
| | | | | | | prefix if the character following it is a valid hex char. The C99 standard is clear that given the string "0xy" zero should be returned and endptr set to point to the "x". OK deraadt@ espie@ | |||||
* | 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@ | |||||
* | Don't fall back to heapsort() if we would otherwise switch to | millert | 2017-05-30 | 1 | -7/+7 | |
| | | | | insertion sort (when the number of elements is < 7). | |||||
* | Support swapping 32-bit aligned elements on 64-bit platforms. | millert | 2017-05-24 | 1 | -22/+63 | |
| | | | | | Previously they would be swapped a byte at a time when sizeof(int) != sizeof(long). Idea from FreeBSD. | |||||
* | Document that qsort falls back to heapsort() if the recursion depth | millert | 2017-05-20 | 1 | -3/+13 | |
| | | | | exceeds 2 lg N and add a reference to the introsort paper. | |||||
* | Use David Musser's introsort algorithm to fall back to heapsort(3) | millert | 2017-05-20 | 2 | -14/+45 | |
| | | | | | | when the recursion depth reaches 2*lg(n + 1). This avoids quicksort's quadratic behavior for pathological input without appreciably changing the average run time. | |||||
* | The BSD qsort() performs tail recursion elimination on the second | millert | 2017-05-17 | 1 | -10/+25 | |
| | | | | | | | | side of the array being partitioned to save on stack space. Greater savings can be gained by choosing recursion for the smaller side of the partition and eliminating recursion for the larger side. This also results in a small but measurable performance gain. OK otto@ schwarze@ | |||||
* | Typo: freezeo -> freezero | tb | 2017-05-15 | 1 | -3/+3 | |
| | | | | From "fenderq" on freenode via tj@ | |||||
* | - fix bug wrt posix_memalign(3) of blocks between half a page and a page | otto | 2017-05-13 | 2 | -8/+18 | |
| | | | | | - document posix_memalign() does not play nice with reacallocarray(3) and freezero(3) | |||||
* | Rearrange text a bit to make it clear what "discarded" means; ok jmc@ deraadt@ | otto | 2017-04-23 | 1 | -8/+13 | |
| | ||||||
* | 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@ | |||||
* | consictently use .Dv NULL and a few other tweaks; ok schwarze@ | otto | 2017-04-17 | 1 | -20/+17 | |
| | ||||||
* | whitespace fixes | otto | 2017-04-17 | 1 | -14/+14 | |
| | ||||||
* | allow clearing less than allocated and document freezero(3) better | otto | 2017-04-13 | 2 | -13/+26 | |
| | ||||||
* | tweak previous; | jmc | 2017-04-10 | 1 | -4/+4 | |
| | ||||||
* | Introducing freezero(3) a version of free that guarantees the process | otto | 2017-04-10 | 2 | -36/+130 | |
| | | | | | | 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@ | |||||
* | Consistentcy between nmembers and size order. From Christopher Hettrick; | otto | 2017-04-06 | 1 | -8/+8 | |
| | | | | ok deraadt@ | |||||
* | first print size in meta-data then supplied arg size when an inconsistency is | otto | 2017-04-06 | 1 | -3/+3 | |
| | | | | detected wrt recallocarray() | |||||
* | rephrase more enumerations of functions | otto | 2017-03-29 | 1 | -13/+10 | |
| | ||||||
* | small cleanup & optimization; ok deraadt@ millert@ | otto | 2017-03-28 | 1 | -2/+5 | |
| |