@@ -2281,7 +2281,6 @@ size_t Process::WriteMemoryPrivate(addr_t addr, const void *buf, size_t size,
2281
2281
return bytes_written;
2282
2282
}
2283
2283
2284
- #define USE_ALLOCATE_MEMORY_CACHE 1
2285
2284
size_t Process::WriteMemory (addr_t addr, const void *buf, size_t size,
2286
2285
Status &error) {
2287
2286
if (ABISP abi_sp = GetABI ())
@@ -2292,12 +2291,8 @@ size_t Process::WriteMemory(addr_t addr, const void *buf, size_t size,
2292
2291
if (buf == nullptr || size == 0 )
2293
2292
return 0 ;
2294
2293
2295
- #if defined(USE_ALLOCATE_MEMORY_CACHE)
2296
2294
if (TrackMemoryCacheChanges () || !m_allocated_memory_cache.IsInCache (addr))
2297
2295
m_mod_id.BumpMemoryID ();
2298
- #else
2299
- m_mod_id.BumpMemoryID ();
2300
- #endif
2301
2296
2302
2297
// We need to write any data that would go where any current software traps
2303
2298
// (enabled software breakpoints) any software traps (breakpoints) that we
@@ -2434,20 +2429,7 @@ addr_t Process::AllocateMemory(size_t size, uint32_t permissions,
2434
2429
return LLDB_INVALID_ADDRESS;
2435
2430
}
2436
2431
2437
- #if defined(USE_ALLOCATE_MEMORY_CACHE)
2438
2432
return m_allocated_memory_cache.AllocateMemory (size, permissions, error);
2439
- #else
2440
- addr_t allocated_addr = DoAllocateMemory (size, permissions, error);
2441
- Log *log = GetLog (LLDBLog::Process);
2442
- LLDB_LOGF (log,
2443
- " Process::AllocateMemory(size=%" PRIu64
2444
- " , permissions=%s) => 0x%16.16" PRIx64
2445
- " (m_stop_id = %u m_memory_id = %u)" ,
2446
- (uint64_t )size, GetPermissionsAsCString (permissions),
2447
- (uint64_t )allocated_addr, m_mod_id.GetStopID (),
2448
- m_mod_id.GetMemoryID ());
2449
- return allocated_addr;
2450
- #endif
2451
2433
}
2452
2434
2453
2435
addr_t Process::CallocateMemory (size_t size, uint32_t permissions,
@@ -2500,21 +2482,10 @@ void Process::SetCanRunCode(bool can_run_code) {
2500
2482
2501
2483
Status Process::DeallocateMemory (addr_t ptr) {
2502
2484
Status error;
2503
- #if defined(USE_ALLOCATE_MEMORY_CACHE)
2504
2485
if (!m_allocated_memory_cache.DeallocateMemory (ptr)) {
2505
2486
error = Status::FromErrorStringWithFormat (
2506
2487
" deallocation of memory at 0x%" PRIx64 " failed." , (uint64_t )ptr);
2507
2488
}
2508
- #else
2509
- error = DoDeallocateMemory (ptr);
2510
-
2511
- Log *log = GetLog (LLDBLog::Process);
2512
- LLDB_LOGF (log,
2513
- " Process::DeallocateMemory(addr=0x%16.16" PRIx64
2514
- " ) => err = %s (m_stop_id = %u, m_memory_id = %u)" ,
2515
- ptr, error.AsCString (" SUCCESS" ), m_mod_id.GetStopID (),
2516
- m_mod_id.GetMemoryID ());
2517
- #endif
2518
2489
return error;
2519
2490
}
2520
2491
0 commit comments