mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-14 22:51:50 +03:00
Fix chunk_recycle() Valgrind integration.
Fix chunk_recycyle() to unconditionally inform Valgrind that returned memory is undefined. This fixes Valgrind warnings that would result from a huge allocation being freed, then recycled for use as an arena chunk. The arena code would write metadata to the chunk header, and Valgrind would consider these invalid writes.
This commit is contained in:
parent
6eb84fbe31
commit
1271185b87
2 changed files with 4 additions and 3 deletions
|
|
@ -10,6 +10,8 @@ found in the git revision history:
|
|||
|
||||
Bug fixes:
|
||||
- Fix "arenas.extend" mallctl to output the number of arenas.
|
||||
- Fix chunk_recycyle() to unconditionally inform Valgrind that returned memory
|
||||
is undefined.
|
||||
|
||||
* 3.2.0 (November 9, 2012)
|
||||
|
||||
|
|
|
|||
|
|
@ -122,10 +122,9 @@ chunk_recycle(extent_tree_t *chunks_szad, extent_tree_t *chunks_ad, size_t size,
|
|||
}
|
||||
base_node_dealloc(node);
|
||||
}
|
||||
if (zeroed == false && *zero) {
|
||||
VALGRIND_MAKE_MEM_UNDEFINED(ret, size);
|
||||
VALGRIND_MAKE_MEM_UNDEFINED(ret, size);
|
||||
if (zeroed == false && *zero)
|
||||
memset(ret, 0, size);
|
||||
}
|
||||
return (ret);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue