mirror of
https://github.com/gperftools/gperftools
synced 2024-12-21 06:50: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);
|
||||
}
|
||||
|
||||
static union {
|
||||
char chars[sizeof(TCMallocImplementation)];
|
||||
void *ptr;
|
||||
} tcmallocimplementation_implementation_space;
|
||||
|
||||
// The constructor allocates an object to ensure that initialization
|
||||
// runs before main(), and therefore we do not have a chance to become
|
||||
// multi-threaded before initialization. We also create the TSD key
|
||||
@ -1129,7 +1124,12 @@ TCMallocGuard::TCMallocGuard() {
|
||||
if (RunningOnValgrind()) {
|
||||
// Let Valgrind uses its own malloc (so don't register our extension).
|
||||
} 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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user