Commit Graph

751 Commits

Author SHA1 Message Date
christos 3ccc6b27b8 remove accidental __strong_alias additions, noticed by coypu. 2017-05-19 19:55:16 +00:00
christos 0a20cdb1cf use strerror_r_ss() 2017-05-19 19:51:10 +00:00
christos 1997642fee The BSD qsort() performs tail recursion elimination on the second
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.
(From OpenBSD)
2017-05-19 19:48:19 +00:00
abhinav 06ea77a20c Clean up the NAME section.
The entries in the NAME section of these man pages have man pages of their
own, so it doesn't make sense to have their names here, instead they
should be just described in the body (similar to what we do in math(3) man page).

This also helps whatis(1) and apropos(1), as otherwise you would see multiple
results with the same name in the output, while there is actually only one page
with that name.

Good example is:

$ apropos -n 2 -M realloc
realloc (3)       general memory allocation operations
realloc (3)       general purpose memory allocation functions

The first line is there because memory(3) man page had realloc in its
NAME section. This commit will fix this issue.

ok wiz@
2017-04-26 07:40:09 +00:00
christos 4251f87df7 PR/51958: Ngie Cooper: ESRCH error description in hcreate(3) contains typo
for action
2017-02-07 22:25:25 +00:00
christos 794a9d5044 use getpagesize(3). 2017-01-13 04:18:54 +00:00
christos 8212adb6e3 Avoid sysconf: __sysconf -> sysctlgetmibinfo -> strtoimax -> locale, etc. 2017-01-12 02:00:42 +00:00
christos 227c2c0795 make this smaller. 2017-01-12 01:02:09 +00:00
abhinav adaa892a13 Fix typo 2016-12-17 06:17:16 +00:00
riastradh 263e13aeed Use the keywords `underflow' and `overflow' in ERANGE summary. 2016-11-07 21:52:36 +00:00
riastradh 95f4e015a9 Fix phrasing about `out-of-band' and `sentinel value'.
Either an out-of-band channel, or an in-band sentinel value, could
indicate an error, but an out-of-band sentinel value is a silly
proposition.

Noted by uwe@.
2016-11-07 21:51:42 +00:00
riastradh 2d9978a06e Update strtoul(3) example to reflect clarifications in strtol(3). 2016-11-05 20:57:31 +00:00
riastradh 02eab895ae Bump date for previous. 2016-11-04 20:19:58 +00:00
riastradh 59495a850c Tidy up the second example too. 2016-11-04 20:18:23 +00:00
riastradh 105424da40 Simplify error condition case.
Add assertions to reflect its implications.
2016-11-04 20:16:18 +00:00
riastradh e465e7c45b Distinguish invalid syntax from trailing garbage cases. Clarify. 2016-11-04 20:14:31 +00:00
riastradh 3a33a135da Distinguish altogether invalid syntax from trailing garbage. 2016-11-04 20:06:09 +00:00
riastradh 95993320dc EXIT_FAILURE police 2016-11-04 20:04:04 +00:00
riastradh fd26083f95 Fix infinity detection with isinf(d), not d == HUGE_VAL.
Negative infinity counts as overflow too.

Simplify.
2016-11-04 19:18:53 +00:00
riastradh e7962ffd1d Add example for strtod.
This illustrates all the cases you might be interested in and asserts
theorems in those cases.
2016-11-04 19:10:04 +00:00
riastradh 7f81880412 Fix description of ERANGE cases again.
Do use the technical terms `overflow' and `underflow', because strtod
sets ERANGE precisely to indicate either of these two conditions, and
they are the right keywords that one might be looking for.

Note that strtod may set ERANGE even if it returns noninfinity and
nonzero -- specifically, if the result is subnormal.  This part was
wrong before I `fixed' it and remained wrong after I `fixed' it
earlier this year.
2016-11-04 18:46:15 +00:00
wiz a948ccc5b2 Fix manually applied patch. Mark up NULL with Dv. 2016-06-01 08:32:05 +00:00
pgoyette 39bee72c5e Document return value for realloc(3) when size is 0. From PR lib/47384 2016-06-01 05:40:26 +00:00
joerg e073a944c0 Fix type name. From Abhinav. 2016-05-01 21:28:21 +00:00
joerg c75fe7b83c lib/50791: Instead of using sorting the arena chunks by address only,
sort by size of the longest run and address as tie break. Avoids long
linear searches for code heavy on medium sized allocations.
2016-04-12 18:07:08 +00:00
roy cdda39d7e5 Revert prior, no idea why it was causing me problems, but it no longer does. 2016-04-06 11:07:58 +00:00
roy da98c8b8e3 Stop calling reallocarr and just do the same bounds checking but without
messing around with copying pointers which was causing ssh to crash.
2016-04-05 15:01:26 +00:00
msaitoh 43e79b977e Add malloc.conf.5 (link to jemalloc.3). 2016-04-01 12:37:48 +00:00
wiz 7230ee2fa7 Bump date for previous. 2016-03-17 09:43:38 +00:00
riastradh dcfb17cada strtod yields ERANGE for below-subnormal magnitudes, not underflow.
For a floating-point computation, in the language of IEEE 754,
`underflow' means the output was rounded and is too small to be
represented *normally*.

There are many nonzero floating-point numbers to which the exact
output may have been rounded -- namely subnormals.  The condition
under which strtod returns ERANGE for small magnitudes is when the
magnitude of the exact result is so small it is rounded to zero, not
even to a subnormal.

While here, use parallel language about large magnitudes instead of
the (albeit correct) word `overflow', to avoid temptation to treat
`underflow' as the opposite notion with zero instead of infinity.
2016-03-17 03:26:15 +00:00
christos f058dc0d02 vmparam.h is a kernel header. 2016-01-24 21:56:43 +00:00
christos e17fe16cac Don't return NULL when we are freeing the root node; return a free'd pointer
instead.
2016-01-20 20:47:41 +00:00
christos 2e3cfa464e PR/50681: Markiyan Kushnir: Fix memory leak when we delete the root node.
It is questionable if we should return NULL in that case, but what is the
parent of root? The new adjusted root?
2016-01-20 15:31:55 +00:00
christos 53ba0e3d35 revert 0b documentation. 2015-11-13 16:00:32 +00:00
wiz 594b3ba9a8 Remove trailing whitespace. 2015-11-13 09:50:31 +00:00
christos 6ea48155ff Now that our source tree has binary constants, recognize them. 2015-11-12 17:30:03 +00:00
wiz dec41c2e36 Use Dv for NULL. 2015-11-07 18:47:26 +00:00
wiz c9e587d5a6 Sort SEE ALSO. 2015-11-07 18:46:37 +00:00
nros b16a5c9dec Add the C11 function aligned_alloc to libc. 2015-11-07 16:21:42 +00:00
kamil 1c79b1c709 ANSIfy getopt(3) - this is the REPLACE_GETOPT version from getopt_long(3)
For the reference, this version still passes the current set of ATF tests
for the getopt(3) function.

This version is by default unused.
2015-09-01 19:39:57 +00:00
kamil 596fd5662e Constness correction for the getopt(3) function under REPLACE_GETOPT
Use the __UNCONST() macro, which is used in the other parts for the same
argument nargv, but under the !REPLACE_GETOPT namespace.
2015-09-01 01:28:17 +00:00
kamil 3bff2c862b Minor alterations to reallocarr(3)
Add comment about division.
Mark error branches with __predict_false().
Reduce one branch with the OR trick.
2015-08-20 22:27:49 +00:00
joerg b7742922d5 Fix portability. 2015-08-20 20:08:04 +00:00
kamil 638c990b9a Compatibility fixes in reallocarr(3)
Make this work on !NetBSD platforms:
- replace __CTASSERT() with platform agnostic solution SQRT_SIZE_MAX
- include nbtool_config.h for cross builds to get definition of __RCSID()
- restore errno in the last rare code path for platforms affecting errno(2)
  in memcpy(2)

While there: rename parameter name 'num' to 'number' to be in sync with
the calloc(3) parameter naming.

Reported by scole_mail at the current-users ml.
2015-07-28 17:13:34 +00:00
wiz d54956fea0 Spacing; Fn -> Xr for jemalloc. 2015-07-26 22:32:03 +00:00
martin def993fa14 Defer using pthread keys until we are threaded.
From Christos, fixes PR port-arm/50087 by allowing malloc calls prior
to libpthread initialization.
2015-07-26 17:21:55 +00:00
kamil 13f3706081 Add history of allocators
Idea accepted by <christos>
No objctions from <riastradh>
2015-07-26 17:09:29 +00:00
christos c0c6a84ba3 From Timo Buhrmester: Fix wrong parameter description 2015-07-26 17:03:06 +00:00
kamil 4f643221a3 mandoc lint 2015-07-26 17:00:37 +00:00
kamil dc83c1546e Add license header (the NetBSD 2-clause version) with (C) TNF 2015-07-26 02:29:44 +00:00