mirror of
https://github.com/gperftools/gperftools
synced 2024-12-30 11:12:03 +00:00
avoid unused variable warning for TCMallocImplementation space
This commit is contained in:
parent
1ba9f60579
commit
fae6421668
@ -1097,11 +1097,6 @@ size_t TCMallocImplementation::GetEstimatedAllocatedSize(size_t size) {
|
|||||||
return tc_nallocx(size, 0);
|
return tc_nallocx(size, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static union {
|
|
||||||
char chars[sizeof(TCMallocImplementation)];
|
|
||||||
void *ptr;
|
|
||||||
} tcmallocimplementation_implementation_space;
|
|
||||||
|
|
||||||
// The constructor allocates an object to ensure that initialization
|
// The constructor allocates an object to ensure that initialization
|
||||||
// runs before main(), and therefore we do not have a chance to become
|
// runs before main(), and therefore we do not have a chance to become
|
||||||
// multi-threaded before initialization. We also create the TSD key
|
// multi-threaded before initialization. We also create the TSD key
|
||||||
@ -1129,7 +1124,12 @@ TCMallocGuard::TCMallocGuard() {
|
|||||||
if (RunningOnValgrind()) {
|
if (RunningOnValgrind()) {
|
||||||
// Let Valgrind uses its own malloc (so don't register our extension).
|
// Let Valgrind uses its own malloc (so don't register our extension).
|
||||||
} else {
|
} else {
|
||||||
MallocExtension::Register(new (tcmallocimplementation_implementation_space.chars) TCMallocImplementation());
|
static union {
|
||||||
|
char chars[sizeof(TCMallocImplementation)];
|
||||||
|
void *ptr;
|
||||||
|
} tcmallocimplementation_space;
|
||||||
|
|
||||||
|
MallocExtension::Register(new (tcmallocimplementation_space.chars) TCMallocImplementation());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user