diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:09:23 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:09:23 +0000 |
| commit | f73363f1dd94996356cefbf24388f561891acf0b (patch) | |
| tree | e3c31248bdb36eaec5fd833490d4278162dba2a0 /source/Target/Memory.cpp | |
| parent | 160ee69dd7ae18978f4068116777639ea98dc951 (diff) | |
Notes
Diffstat (limited to 'source/Target/Memory.cpp')
| -rw-r--r-- | source/Target/Memory.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/source/Target/Memory.cpp b/source/Target/Memory.cpp index ced359418682..ad1b4093155d 100644 --- a/source/Target/Memory.cpp +++ b/source/Target/Memory.cpp @@ -133,12 +133,12 @@ size_t MemoryCache::Read(addr_t addr, void *dst, size_t dst_len, Status &error) { size_t bytes_left = dst_len; - // Check the L1 cache for a range that contain the entire memory read. - // If we find a range in the L1 cache that does, we use it. Else we fall - // back to reading memory in m_L2_cache_line_byte_size byte sized chunks. - // The L1 cache contains chunks of memory that are not required to be - // m_L2_cache_line_byte_size bytes in size, so we don't try anything - // tricky when reading from them (no partial reads from the L1 cache). + // Check the L1 cache for a range that contain the entire memory read. If we + // find a range in the L1 cache that does, we use it. Else we fall back to + // reading memory in m_L2_cache_line_byte_size byte sized chunks. The L1 + // cache contains chunks of memory that are not required to be + // m_L2_cache_line_byte_size bytes in size, so we don't try anything tricky + // when reading from them (no partial reads from the L1 cache). std::lock_guard<std::recursive_mutex> guard(m_mutex); if (!m_L1_cache.empty()) { @@ -155,11 +155,11 @@ size_t MemoryCache::Read(addr_t addr, void *dst, size_t dst_len, } } - // If this memory read request is larger than the cache line size, then - // we (1) try to read as much of it at once as possible, and (2) don't - // add the data to the memory cache. We don't want to split a big read - // up into more separate reads than necessary, and with a large memory read - // request, it is unlikely that the caller function will ask for the next + // If this memory read request is larger than the cache line size, then we + // (1) try to read as much of it at once as possible, and (2) don't add the + // data to the memory cache. We don't want to split a big read up into more + // separate reads than necessary, and with a large memory read request, it is + // unlikely that the caller function will ask for the next // 4 bytes after the large memory read - so there's little benefit to saving // it in the cache. if (dst && dst_len > m_L2_cache_line_byte_size) { @@ -218,9 +218,9 @@ size_t MemoryCache::Read(addr_t addr, void *dst, size_t dst_len, bytes_left -= curr_read_size; curr_addr += curr_read_size; - // We have a cache page that succeeded to read some bytes - // but not an entire page. If this happens, we must cap - // off how much data we are able to read... + // We have a cache page that succeeded to read some bytes but not + // an entire page. If this happens, we must cap off how much data + // we are able to read... if (pos->second->GetByteSize() != cache_line_byte_size) return dst_len - bytes_left; } @@ -277,8 +277,8 @@ lldb::addr_t AllocatedBlock::ReserveBlock(uint32_t size) { if (range_size >= size) { // We found a free block that is big enough for our data. Figure out how - // many chunks we will need and calculate the resulting block size we will - // reserve. + // many chunks we will need and calculate the resulting block size we + // will reserve. addr_t addr = free_block.GetRangeBase(); size_t num_chunks = CalculateChunksNeededForSize(size); lldb::addr_t block_size = num_chunks * m_chunk_size; @@ -296,8 +296,8 @@ lldb::addr_t AllocatedBlock::ReserveBlock(uint32_t size) { // Make the new allocated range and add it to the allocated ranges. Range<lldb::addr_t, uint32_t> reserved_block(free_block); reserved_block.SetByteSize(block_size); - // Insert the reserved range and don't combine it with other blocks - // in the reserved blocks list. + // Insert the reserved range and don't combine it with other blocks in + // the reserved blocks list. m_reserved_blocks.Insert(reserved_block, false); // Adjust the free range in place since we won't change the sorted // ordering of the m_free_blocks list. |
