Commit graph

6 commits

Author SHA1 Message Date
Dag-Erling Smørgrav
06a757e878 Big reorganization and cleanup 2016-09-04 14:56:39 +02:00
Dag-Erling Smørgrav
4d1703c77a Don't try to memset NULL if allocation fails.
Always emit UTRACE records, even for failed allocations.
When allocating more than was requested, fill the slop with garbage.
2016-02-19 12:23:17 +01:00
Dag-Erling Smørgrav
5584b68908 Fix t_malloc_snapshot(): stash the difference between nalloc and nfree,
not the numbers themselves.

In t_malloc_printstats(), show information about mapped allocations.

In t_malloc_leaked(), check for leaked mapped allocations.  Note that
they would show up anyway since the metadata are allocated from the
bucket allocator, but this makes them more visible.
2015-11-02 19:45:12 +00:00
Dag-Erling Smørgrav
955cbc3013 Add t_malloc_snapshot() which writes a snapshot of the allocator state to
a caller-provided buffer.  Use it to warn about leaks in each individual
test case.  Note that we can't fail a test case for leaking, because
individual test cases in a unit may modify shared state which is cleaned
up at the end of the series.
2015-11-02 19:34:03 +00:00
Dag-Erling Smørgrav
0a9f2c21fe When running a test, make sure it didn't leave allocation failure enabled.
Add predicates for null and non-null pointers.
Staticize some internal allocator state.
2015-10-13 21:39:47 +00:00
Dag-Erling Smørgrav
f8ebdbc14d Move the test framework into its own subdirectory 2015-10-04 07:49:48 +00:00
Renamed from t/t_malloc.c (Browse further)