| 361 | |
| 362 | extern "C" |
| 363 | int MallocHook_SetMmapReplacement(MallocHook_MmapReplacement hook) { |
| 364 | RAW_VLOG(10, "SetMmapReplacement(%p)", hook); |
| 365 | // NOTE this is a best effort CHECK. Concurrent sets could succeed since |
| 366 | // this test is outside of the Add spin lock. |
| 367 | RAW_CHECK(mmap_replacement_.empty(), "Only one MMapReplacement is allowed."); |
| 368 | return mmap_replacement_.Add(hook); |
| 369 | } |
| 370 | |
| 371 | extern "C" |
| 372 | int MallocHook_RemoveMmapReplacement(MallocHook_MmapReplacement hook) { |
no test coverage detected