summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert addtion of assertions in revision 1.99. These assertions causeJason Evans2006-01-191-7/+0
| | | | | | | | | problems in cases where regions are faked up for the purposes of red-black tree searches, since those faked region headers reside on the stack, rather than in a malloc chunk. Notes: svn path=/head/; revision=154557
* Add assertions that detect some forms of region separator corruption.Jason Evans2006-01-191-0/+7
| | | | Notes: svn path=/head/; revision=154556
* Remove loops in arena_coalesce(). They are no longer necessary, now thatJason Evans2006-01-191-4/+5
| | | | | | | | internal allocation does not rely on recursive arena use (base_arena was removed in revision 1.95). Notes: svn path=/head/; revision=154555
* Make all internal variables and functions static.Jason Evans2006-01-191-12/+15
| | | | | | | Reported by: ache Notes: svn path=/head/; revision=154549
* Return NULL if there is an OOM error during initialization, rather thanJason Evans2006-01-191-35/+50
| | | | | | | | | | | allowing the error to be fatal. Move a label in order to make sure to properly handle errors in malloc(0). Reported by: Alastair D'Silva, Saneto Takanori Notes: svn path=/head/; revision=154546
* Add a separate simple internal base allocator and remove base_arena, so thatJason Evans2006-01-161-151/+175
| | | | | | | | | | | | | there is never any need to recursively call the main allocation functions. Remove recursive spinlock support, since it is no longer needed. Allow chunks to be as small as the page size. Correctly propagate OOM errors from arena_new(). Notes: svn path=/head/; revision=154421
* Define NO_TLS on ia64. The dynamic TLS implementation on ia64 isMarcel Moolenaar2006-01-161-0/+1
| | | | | | | | | | | | broken for non-threaded shared processes in that __tls_get_addr() assumes the thread pointer is always initialized. This is not the case. When arenas_map is referenced in choose_arena() and it is defined as a thread-local variable, it will result in a SIGSEGV. PR: ia64/91846 (describes the TLS/ia64 bug). Notes: svn path=/head/; revision=154415
* Replace malloc(), calloc(), posix_memalign(), realloc(), and free() withJason Evans2006-01-132-1107/+4597
| | | | | | | | | | a scalable concurrent allocator implementation. Reviewed by: current@ Approved by: phk, markm (mentor) Notes: svn path=/head/; revision=154306
* Fix a bitwise logic error in posix_memalign().Jason Evans2006-01-121-2/+2
| | | | | | | Reported by: glebius Notes: svn path=/head/; revision=154263
* In preparation for a new malloc implementation:Jason Evans2006-01-124-63/+156
| | | | | | | | | | | | | | | | * Add posix_memalign(). * Move calloc() from calloc.c to malloc.c. Add a calloc() implementation in rtld-elf in order to make the loader happy (even though calloc() isn't used in rtld-elf). * Add _malloc_prefork() and _malloc_postfork(), and use them instead of directly manipulating __malloc_lock. Approved by: phk, markm (mentor) Notes: svn path=/head/; revision=154248
* Add a64l(), l64a(), and l64a_r() XSI extentions. These functions convertTom Rhodes2005-12-244-5/+290
| | | | | | | | | | | between a 32-bit integer and a radix-64 ASCII string. The l64a_r() function is a NetBSD addition. PR: 51209 (based on submission, but very different) Reviewed by: bde, ru Notes: svn path=/head/; revision=153707
* Fix prototype.Ruslan Ermilov2005-11-231-1/+3
| | | | Notes: svn path=/head/; revision=152734
* Include a couple of headers to ensure consistency between the prototype andStefan Farfeleder2005-09-121-0/+1
| | | | | | | the function definition. Notes: svn path=/head/; revision=150065
* Move the declaration of __cleanup to libc_private.h as it is used in bothStefan Farfeleder2005-09-122-2/+4
| | | | | | | stdio/ and stdlib/. Don't define __cleanup twice. Notes: svn path=/head/; revision=150040
* Fix ptsname(3) by converting it to use devname(3) to obtain the name ofJoe Marcus Clarke2005-07-071-3/+4
| | | | | | | | | | | | | | | a tty device instead of the legacy minor number approach. This is known to fix gnome-vfs' sftp module as well as kio_sftp and kdesu on -CURRENT. Thanks to scottl for the snprintf() approach idea. Reviewed by: phk Tested by: pav mich Approved by: re (scottl) Notes: svn path=/head/; revision=147811
* Do not require the pty(4) majors to be anything in particular.Brian Feldman2005-03-041-3/+0
| | | | Notes: svn path=/head/; revision=143137
* Remove the check about whether MALLOC_EXTRA_SANITY is defined,Xin LI2005-02-271-2/+0
| | | | | | | | | | | | surrounding the undef'ing it. It does not seem necessary to undef some symbol that is not exist, and gcc does not complain about whether a symbol is exist before #undef'ing it out. Spotted by: mingyanguo via ChinaUnix.net forum Reviewed by: phk Notes: svn path=/head/; revision=142668
* Especially mention that setting errno to EINVAL in "no conversion" caseAndrey A. Chernov2005-01-222-4/+8
| | | | | | | | | is not portable. Asked by: joerg Notes: svn path=/head/; revision=140613
* Whitespace/style tweaking of prev. commit.Andrey A. Chernov2005-01-216-24/+18
| | | | | | | Noted by: bde Notes: svn path=/head/; revision=140577
* POSIX says that 0[xX] prefix is _optional_ even in base 16 case, make itAndrey A. Chernov2005-01-216-6/+30
| | | | | | | | | | | | | really so. "If the value of base is 16, the characters 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present." Found by: joerg Notes: svn path=/head/; revision=140536
* Sort sections.Ruslan Ermilov2005-01-209-77/+77
| | | | Notes: svn path=/head/; revision=140505
* Markup fixes.Ruslan Ermilov2005-01-141-6/+6
| | | | Notes: svn path=/head/; revision=140262
* Fix some signed/unsigned comparisons. Fix prototypes while I'm here.Brian Somers2005-01-121-3/+6
| | | | | | | | | PR: 28890 Submitted by: matthias.andree at web dot de MFC after: 7 days Notes: svn path=/head/; revision=140098
* sranddev() is not magic pixie dust. While it gives a good randomWarner Losh2004-11-101-2/+4
| | | | | | | | | | | seed, the random number generator rand(3) still sucks and is unlikely sufficient for crypto use. Correct what appears to be a cut and paste error from the srandomdev() man page. Submitted by: Ben Mesander Notes: svn path=/head/; revision=137535
* Reword recent addition about memory moving.Alfred Perlstein2004-08-191-5/+4
| | | | | | | | | | | Requested by: keramida Bump .Dd Requested by: ru Notes: svn path=/head/; revision=134020
* Clarify that realloc and reallocf may move the memory allocation.Alfred Perlstein2004-08-181-3/+7
| | | | Notes: svn path=/head/; revision=133985
* Use #include <unistd.h> rather than the explicit externs in theWarner Losh2004-07-311-2/+1
| | | | | | | | | example. The externs haven't been needed in about 10 years, so there's no reason to have them other than for hysterical raisins. And the California Rasins haven't been around for a long time... Notes: svn path=/head/; revision=132910
* mdoc(7) fixes.Ruslan Ermilov2004-07-071-2/+3
| | | | Notes: svn path=/head/; revision=131754
* Move the return value information about the getenv(3) library functionHiten Pandya2004-07-061-4/+10
| | | | | | | | | | | | under the RETURN VALUES section so it is consistent with others. Cleanup the return value text for getenv(3) a little while I am here. PR: docs/58033 MFC after: 3 days Notes: svn path=/head/; revision=131728
* Keep it sync with OpenBSD:Andrey A. Chernov2004-07-061-3/+4
| | | | | | | | | | An optional argument cannot start with '-', even if permutation is disabled. Obtained from: OpenBSD getopt_long.c v1.17 Notes: svn path=/head/; revision=131710
* Sort SEE ALSO references (in dictionary order, ignoring case).Ruslan Ermilov2004-07-041-1/+1
| | | | Notes: svn path=/head/; revision=131594
* Consistently use __inline instead of __inline__ as the former is an empty macroStefan Farfeleder2004-07-041-3/+3
| | | | | | | in <sys/cdefs.h> for compilers without support for inline. Notes: svn path=/head/; revision=131575
* Eliminate double whitespace.Ruslan Ermilov2004-07-031-4/+4
| | | | Notes: svn path=/head/; revision=131539
* Mechanically kill hard sentence breaks.Ruslan Ermilov2004-07-025-14/+30
| | | | Notes: svn path=/head/; revision=131504
* Define malloc_pageshift and malloc_minsize for arm.Olivier Houchard2004-05-141-0/+4
| | | | Notes: svn path=/head/; revision=129200
* Link radixsort(3) to sradixsort(3), make the latter appear inRuslan Ermilov2004-05-122-1/+2
| | | | | | | the whatis(1) output. Notes: svn path=/head/; revision=129151
* Simplify one condition in prev. commit:Andrey A. Chernov2004-04-011-2/+1
| | | | | | | short_too already assumes FLAG_LONGONLY Notes: svn path=/head/; revision=127734
* Fix parsing of ambiguous options, whole loop must be processedAndrey A. Chernov2004-04-011-17/+27
| | | | Notes: svn path=/head/; revision=127733
* Rearrange (centralize) initialization of mallocs internals to always bePoul-Henning Kamp2004-03-071-19/+13
| | | | | | | | | done before the first call, even if this is a malloc(0) call. PR: 62859 Notes: svn path=/head/; revision=126727
* Merge some fixes from NetBSD's getopt.3 v1.31:Andrey A. Chernov2004-03-061-43/+88
| | | | | | | cleanup, add more sections, better explanation, declaration Notes: svn path=/head/; revision=126697
* Merge some fixes from NetBSD's getopt.c v1.26:Andrey A. Chernov2004-03-061-26/+43
| | | | | | | | | | | cleanups, handling 'ls -l-', handling '--*' Note this is in the same time back out of our v1.3 "Don't print an error message if the bad option is '?'" because it directly violates POSIX. Notes: svn path=/head/; revision=126696
* Fix typo, was 'W'; instead of `W;'Andrey A. Chernov2004-03-061-1/+1
| | | | Notes: svn path=/head/; revision=126693
* Make GNU-compatible following case:Andrey A. Chernov2004-03-062-23/+27
| | | | | | | single '-' in command line and '-' (non-first) in options Notes: svn path=/head/; revision=126692
* Make return code in noarg case GNU-compatibleAndrey A. Chernov2004-03-032-20/+24
| | | | Notes: svn path=/head/; revision=126535
* Be more GNU-compatible in diagnosticsAndrey A. Chernov2004-03-031-11/+61
| | | | Notes: svn path=/head/; revision=126518
* Improve GNU compatibility in several places, use internal GNU_COMPATIBLEAndrey A. Chernov2004-03-012-29/+49
| | | | | | | | | | define for it. Don't catch POSIXLY_CORRECT env. into static variable, it can be changed on the fly by program. Use P1003.2 standartized illoptchar[] Notes: svn path=/head/; revision=126452
* Comment out things related to getopt() replacement we not useAndrey A. Chernov2004-03-011-36/+36
| | | | Notes: svn path=/head/; revision=126440
* Change "-"-started options when POSIX_CORRECTLY is set handlingAndrey A. Chernov2004-03-011-17/+17
| | | | | | | | in favour of GNU instead of NetBSD, because configure's use us and expect GNU. Notes: svn path=/head/; revision=126439
* Change "-"-started options when POSIX_CORRECTLY is set handlingAndrey A. Chernov2004-03-011-1/+5
| | | | | | | | in favour of GNU instead of NetBSD, because configure's use us and expect GNU. Notes: svn path=/head/; revision=126438
* Add getopt_long_only() from OpenBSD and other OpenBSD cleanupsAndrey A. Chernov2004-02-243-299/+459
| | | | | | | | PR: 63173 Submitted by: Marius Strobl <marius@alchemy.franken.de> Notes: svn path=/head/; revision=126189