Bug 1087245 part 1 - Allow replace-malloc libraries to register debug file handles to poison IO interposer. r=nfroyd
This commit is contained in:
@@ -32,6 +32,10 @@
|
||||
#include <dlfcn.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef MOZ_REPLACE_MALLOC
|
||||
#include "replace_malloc_bridge.h"
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
using namespace mozilla;
|
||||
@@ -342,6 +346,14 @@ InitPoisonIOInterposer()
|
||||
MozillaRegisterDebugFD(1);
|
||||
MozillaRegisterDebugFD(2);
|
||||
|
||||
#ifdef MOZ_REPLACE_MALLOC
|
||||
// The contract with InitDebugFd is that the given registry can be used
|
||||
// at any moment, so the instance needs to persist longer than the scope
|
||||
// of this functions.
|
||||
static DebugFdRegistry registry;
|
||||
ReplaceMalloc::InitDebugFd(registry);
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < NumFunctions; ++i) {
|
||||
FuncData* d = Functions[i];
|
||||
if (!d->Function) {
|
||||
|
||||
Reference in New Issue
Block a user