summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Make all combinations of G, P, J and zero-fill work with as littleotto2008-08-251-5/+20
| | | | effort as possible in most cases; ok djm@
* unbreak MALLOC_OPTIONS=G that I broke in my last commit;djm2008-08-231-3/+3
| | | | slightly kludgey solution for until otto fixes it properly; ok otto@
* fix calloc() for MALLOC_OPTIONS=J case: SOME_JUNK was being filled intodjm2008-08-231-2/+2
| | | | | the freshly mmaped pages disrupting their pure zeroness; ok otto@ deraadt@
* make sure we always map and unmap multiples of MALLOC_PAGESIZE;otto2008-08-221-5/+14
| | | | case spotted by beck, one by me; ok deraadt@ beck@
* Smarter implementation of calloc(3), which uses the fact that mmap(2)otto2008-08-222-8/+57
| | | | | returns zero filled pages; remember to replace this function as well if you provide your own malloc implementation; ok djm@ deraadt@
* small cleanup of error/warning stringsotto2008-08-072-7/+7
|
* man page bits for new malloc; ok jmc@otto2008-07-281-43/+33
|
* Almost complete rewrite of malloc, to have a more efficient dataotto2008-07-281-1443/+835
| | | | | | structure of tracking pages returned by mmap(). Lots of testing by lots of people, thanks to you all. ok djm@ (for a slighly earlier version) deraadt@
* First pass at removing clauses 3 and 4 from NetBSD licenses.ray2008-06-261-9/+2
| | | | | | | | | Not sure what's more surprising: how long it took for NetBSD to catch up to the rest of the BSDs (including UCB), or the amount of code that NetBSD has claimed for itself without attributing to the actual authors. OK deraadt@
* grammar fixes;jmc2008-06-131-3/+3
|
* remove _MALLOC_LOCK_INIT; major bump; ok deraadt@otto2008-06-131-3/+1
|
* Add strtof() to libc, some ports seem to like it. Currently it's a simplelandry2008-06-133-9/+64
| | | | | | | call to strtod() with bounding check. Discussed with pyr@ and otto@ ok otto@ deraadt@
* kill an Xr to a non-existent man page, ulimit(1);jmc2008-05-201-5/+3
|
* remove recalloc(3); it is buggy and impossible to repair without bigotto2008-05-193-62/+20
| | | | costs; ok jmc@ for the man page bits; ok millert@ deraadt@
* Use arc4random_buf() when requesting more than a single word of outputdjm2008-04-131-2/+2
| | | | | | | Use arc4random_uniform() when the desired random number upper bound is not a power of two ok deraadt@ millert@
* - do not call pthread_atfork(3) handlers when a multithreaded programkurt2008-04-041-2/+7
| | | | | | calls vfork(2). "untested, but looks OK" marc@ - document vfork(2), popen(3) and system(3) don't call atfork handlers in multithreaded programs. okay jmc@
* use pgfree pool like other code does to reserve free list slots.otto2008-02-201-6/+6
| | | | | prevents a few "cannot free mem because i need mem to free mem" scenarios (one found by weingart@). ok weingart@ millert@ miod@
* Put limits.h in front of stdlib.h as style(9) recommends.tobias2007-11-132-8/+8
| | | | OK millert@
* strtod may return HUGE_VAL on overflow, which is defined in math.h.tobias2007-11-111-2/+3
| | | | | | Therefore added math.h to SYNPOSIS. OK millert@
* Add parentheses to avoid warning:chl2007-10-311-2/+2
| | | | | | "suggest parentheses around && within ||" ok millert@
* Add missing header to avoid warningchl2007-09-051-1/+2
| | | | ok millert@ ray@
* no need to talk about bits; ok millert jmcderaadt2007-09-051-3/+3
|
* Update free(3) section--we use mmap()/munmap(), not brk().millert2007-09-031-4/+6
| | | | Based on a diff from Mike Belopuhov. OK jmc@
* Add __cxa_atexit() support for gcc3. This provides support for shared ↵millert2007-09-034-30/+108
| | | | object destructors called at dlclose() time. Inspired by similar changes in FreeBSD and NetBSD.
* add recaloc(3)millert2007-09-033-20/+62
|
* use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsgderaadt2007-09-022-4/+4
|
* Clarify the example about avoiding overflow. OK ray@ deraadt@millert2007-08-081-3/+3
|
* Reference limits.h, not sys/param.h since we document using PATH_MAXmillert2007-07-061-3/+3
| | | | OK otto@
* from ginsbach@netbsd, -r1.18:jmc2007-07-031-2/+7
| | | | | | | | Document that getopt_long(3) can and will accept unique abbreviated long option names. This feature has been present since getopt_long(3) was first released in NetBSD 1.5. This is also standard GNU getopt_long(3) behavior. ok millert
* Document behavior when no conversion could be performed. Adaptedmillert2007-06-292-5/+17
| | | | from FreeBSD. With help from jmc@.
* convert to new .Dd format;jmc2007-05-3140-80/+80
|
* Support for optional args separated with whitespace was removedmillert2007-04-101-17/+1
| | | | some time ago--it caused too many problems.
* get cheaper random bytes, less waste and no getpid() calls, which areotto2007-02-121-2/+3
| | | | done by arc4random(); ok millert@ deraadt@
* fix some dodgy displays;jmc2007-02-061-2/+2
|
* sync with the code: int -> intmax_tsteven2007-01-161-3/+3
| | | | ok jmc@
* advertising clauses that can be droppedderaadt2007-01-081-6/+2
|
* a failed mmap returns MAP_FAILED, not NULL. found while exercising paxotto2006-12-191-3/+3
| | | | in low-mem conditions; ok dim@
* columns for underflow and overflow were swapped, noticed by Mathieu Oliviergrunk2006-11-021-2/+2
| | | | | | <molivier at users dot sourceforge dot net> ok jmc@ mickey@
* must pull in sys/types.h unconditionaly, because it is needed my pthreadsderaadt2006-10-301-2/+2
| | | | includes used a bit later (for instance on the vax)
* make __dtoa & strtod() thread-safe useing the same method as newer gdtoaderaadt2006-10-293-36/+89
| | | | | codebase. tested mostly by ckuethe and myself. __dtoa() use now requires a call to __freedtoa()
* respond to ben hawkes's ruxcon presentation.tedu2006-10-241-61/+125
| | | | | | | | | | | | | create special allocators for pginfo and pgfree structs instead of imalloc. this keeps them separated from application memory. for chunks, to prevent deterministic reuse, keep a small array and swizzle the to be freed chunk with a random previously freed chunk. this last bit only for chunks because keeping arbitrarily large regions of pages around may cause out of memory issues (and pages are, to some extent, returned in random order). all changes enabled by default. thanks to ben for pointing out these issues. ok tech@
* __mips64__ handling too.. sighderaadt2006-10-131-4/+5
|
* sparc64 should be in the #ifdefderaadt2006-10-121-2/+2
|
* use __amd64__ instead, until lint is fixedderaadt2006-10-121-2/+2
|
* reorder #if tests because apparently on amd64 cpp proceeds to blow it'sderaadt2006-10-121-3/+4
| | | | own brains out, and then takes lint down with it. To be investigated...
* Teach'em about cpus in spandexmiod2006-10-101-4/+4
|
* from wiz@netbsd:jmc2006-10-041-8/+1
| | | | | | Log Message: Switch from 4-clause to 2-clause BSD license. Ok dillo@, board@.
* Make a var volatile, which forces a mem write at the right spot, andotto2006-10-011-2/+7
| | | | | | detctecion of underflow where it would otherwise not happen for FPUs that have a larger register size than sizeof double (i386, m68k). ok deraadt@ weingart@ kettenis@
* Back out change in rev 1.15 of to allow whitespace to separate amillert2006-09-221-10/+1
| | | | | | | | | flag from its optional argument if permutation is disabled. The idea was that since "r:" would match "-r foo" then "r::" should match "-r foo" too as long as we know that things have not been reshuffled. Unfortunately, this causes incompatibilities with GNU getopt_long when the POSIXLY_CORRECT environment variable is set. OK deraadt@
* Fix 'double by a factor of two' and make cache options a bit morepedro2006-06-061-4/+4
| | | | descriptive while at it, input and okay jmc@