mirror of
https://github.com/apple/foundationdb.git
synced 2025-06-01 10:45:56 +08:00
Add reference to valgrind docs
This commit is contained in:
parent
32cd90cf05
commit
9a87a19fc8
@ -20,6 +20,8 @@
|
||||
|
||||
#include "Arena.h"
|
||||
|
||||
// See https://dox.ipxe.org/memcheck_8h_source.html and https://dox.ipxe.org/valgrind_8h_source.html for an explanation
|
||||
// of valgrind client requests
|
||||
#ifdef USE_VALGRIND
|
||||
#include <memcheck.h>
|
||||
#else
|
||||
@ -28,6 +30,11 @@
|
||||
#define VALGRIND_MAKE_MEM_UNDEFINED(addr, size) ((void)(addr), (void)(size))
|
||||
#endif
|
||||
|
||||
// For each use of arena-internal memory (e.g. ArenaBlock::getSize()), unpoison the memory before use and
|
||||
// poison it when done.
|
||||
// When creating a new ArenaBlock, poison the memory that will be later allocated to users.
|
||||
// When allocating memory to a user, mark that memory as undefined.
|
||||
|
||||
namespace {
|
||||
void unpoison(ArenaBlock* b) {
|
||||
if (b) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user