otto
979a770ed0
don't forget to fill in canary bytes for posix_memalign(3); reported by
and ok jeremy@
8 years ago
otto
6746db08da
consictently use .Dv NULL and a few other tweaks; ok schwarze@
8 years ago
otto
f7bddd982e
whitespace fixes
8 years ago
otto
80c2ebad1c
allow clearing less than allocated and document freezero(3) better
8 years ago
jmc
dc395db8fa
tweak previous;
8 years ago
otto
92d2cf9d5b
Introducing freezero(3) a version of free that guarantees the process
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@
8 years ago
otto
7c0adfa87b
Consistentcy between nmembers and size order. From Christopher Hettrick;
ok deraadt@
8 years ago
otto
253b92f197
first print size in meta-data then supplied arg size when an inconsistency is
detected wrt recallocarray()
8 years ago
otto
f73e526d1b
rephrase more enumerations of functions
8 years ago
otto
c1fcb739fc
small cleanup & optimization; ok deraadt@ millert@
8 years ago
otto
cf1d70783e
Stop enumeration all allocation functions, just say "allocation functions"
ok jmc@ deraadt@
8 years ago
otto
c662774838
add a helper function to print all pools #ifdef MALLOC_STATS
from David CARLIER
8 years ago
otto
a937a37bc9
document new recallocarray diagnostic; zap a few diagnostics that should
never occur
8 years ago
otto
5b40b56851
move recallocarray to malloc.c and
- use internal meta-data to do more consistency checking (especially with
option C)
- use cheap free if possible
ok deraadt@
8 years ago
jmc
d6f7c19958
remove unneccessary macro;
8 years ago
deraadt
826b373fa7
Strengthen description of recallocarray(3) behaviour, hoping that readers
make the behaviour -> use case connection.
help from jmc and jsing
8 years ago
otto
dddd0ad99b
Some tweaks from jmc@ and describe better what recallocarray does;
help and ok from tom@ and deraadt@
8 years ago
otto
6cec33e265
Introducing recallocarray(3), a blend of calloc(3) and reallocarray(3)
with the added feature that released memory is cleared. Much input from various
developers. ok deraadt@ tom@
8 years ago
jsg
d08f908fca
Add a NULL test to wrterror() to avoid a NULL deref when called from a
free() error path.
ok otto@
8 years ago
otto
07baa34ee0
malloc does not *need* to return page-aligned objects for size >=
a page. This is not required by any standard and other malloc
implementation do not document (or implement) this. ok deraadt@
8 years ago
otto
a82fcd44e6
fix a comment and rm some dead code as a result of the previous diff
8 years ago
otto
4a9a7195d2
Let realloc handle and produce moved pointers for allocations between
half a page and a page. ok jmatthew@ tb@
8 years ago
otto
3d80117872
1. When shrinking a chunk allocation, compare the size of the current
allocation to the size of the new allocation (instead of the requested size).
2. Previously realloc takes the easy way and always reallocates if C is
active. This commit fixes by carefully updating the recorded requested
size in all cases, and writing the canary bytes in the proper location
after reallocating.
3. Introduce defines to test if MALLOC_MOVE should be done and to
compute the new value.
8 years ago
millert
bf9b74c4ba
Remove unnecessary casts of 'a' to char * since 'a' is already char *.
This is a remnant from the original 4.4BSD code that had 'a' as
void * in the function args. No binary change. OK bluhm@
8 years ago
otto
099c1cfdb8
MALLOC_STATS tweaks, by default not compiled in
8 years ago
otto
a197637f0f
small tweak to also check canaries if F is in effect
8 years ago
otto
8119a345a7
remove some old option letters and also make P non-settable. It has
been the default for ages, and I see no valid reason to be able to
disable it. ok natano@
8 years ago
otto
ae5357c652
Pages in the malloc cache are either reused quickly or unmapped
quickly. In both cases it does not make sense to set hints on them.
So remove that option, which is just a remainder of old times when
malloc used to hold on to pages. ok stefan@
8 years ago
tb
3968c88c54
$OpenBSD$
8 years ago
otto
992807bce2
- fix MALLOC_STATS compile
- redundant cast is redundant
8 years ago
otto
03ffdf003d
fix some void * arithmetic by casting
8 years ago
otto
1255da53a3
and recommit with fixed GC
8 years ago
otto
5d783ecc04
backout for now; flag combination GC is not ok
8 years ago
jmc
1a2414b3e4
avoid sentence splicing;
8 years ago
otto
e2ace002f9
canary corruption message changed a bit
8 years ago
otto
5656d7bf98
Also place canaries in > page sized objects (if C is in effect); ok tb@
8 years ago
guenther
71af4d5f52
Wrap _malloc_init() so internal calls go directly
prodded by otto@
ok kettenis@ otto@
8 years ago
otto
c00ceb22a8
0xd0 -> 0xdb; ok deraadt@ millert@ tedu@
8 years ago
otto
8b706cc40e
optimize canary code a bit by storing offset of sizes table instead of
recomputing it all the time
8 years ago
otto
1ae413d0f7
make clear the length printed is the requested length
8 years ago
jmc
ede9249779
grammar fix previous;
8 years ago
otto
41daf65553
document "chunk canary corrupted" error
8 years ago
otto
3eeb2e7bb1
stray tab
8 years ago
otto
2c67f40d2b
Beter implementation of chunk canaries: store size in chunk meta data
instead of chunk itself; does not change actual allocated size; ok tedu@
8 years ago
guenther
1a1f277cca
Delete casts to off_t and size_t that are implied by assignments
or prototypes. Ditto for some of the char* and void* casts too.
verified no change to instructions on ILP32 (i386) and LP64 (amd64)
ok natano@ abluhm@ deraadt@ millert@
8 years ago
otto
814803d97e
move page junking tp unmap(), right before we stick the region in the cache;
ok tedu@
8 years ago
jmc
ea651fa3ce
fix Dt;
8 years ago
nicm
51319d983d
Set errno more consistently, and fix a warning, ok tedu
8 years ago
tedu
acdfcc40f1
rm
8 years ago
tedu
80b2ef3b15
oops, name file after main function
8 years ago