src/map.c
static inline void mem_map_entry_traversal_init(Mem_Map_Traversal* traversal,
                                                Addr va, uns size) {
  Addr last_va = ADDR_PLUS_OFFSET(va, size - 1);  // last byte in access
  traversal->first_entry_addr       = MEM_MAP_ENTRY_ADDR(va);
  traversal->last_entry_addr        = MEM_MAP_ENTRY_ADDR(last_va);
  traversal->entry_addr             = traversal->first_entry_addr;
  traversal->first_entry_first_byte = MEM_MAP_BYTE_IN_ENTRY(va);
  traversal->last_entry_last_byte   = MEM_MAP_BYTE_IN_ENTRY(last_va);

  if(0 == size) {
    // special case - if the size is 0, we shouldn't do a traversal at all, so
    // force the traversal to be "done"
    traversal->entry_addr = ADDR_PLUS_OFFSET(traversal->last_entry_addr,
                                             MEM_MAP_ENTRY_SIZE);
    ASSERT(get_proc_id_from_cmp_addr(va),
           mem_map_entry_traversal_done(traversal));
  }
}
/**************************************************************************************/
/* map_mem_*_traversal_*: these functions traverse the memory map
   entries and bytes within those entries given an access with an
   address and size. */
map_mem_*_traversal_*: these functions traverse the memory map
entries and bytes within those entries given an access with an
address and size.
map_mem_ * _traversal_ * : these functions traverse the memory map entries and bytes within those entries given an access with an address and size .
static inline void mem_map_entry_traversal_init(Mem_Map_Traversal* traversal,
                                                Addr va, uns size) {
  Addr last_va = ADDR_PLUS_OFFSET(va, size - 1);  
  traversal->first_entry_addr       = MEM_MAP_ENTRY_ADDR(va);
  traversal->last_entry_addr        = MEM_MAP_ENTRY_ADDR(last_va);
  traversal->entry_addr             = traversal->first_entry_addr;
  traversal->first_entry_first_byte = MEM_MAP_BYTE_IN_ENTRY(va);
  traversal->last_entry_last_byte   = MEM_MAP_BYTE_IN_ENTRY(last_va);
  if(0 == size) {
    traversal->entry_addr = ADDR_PLUS_OFFSET(traversal->last_entry_addr,
                                             MEM_MAP_ENTRY_SIZE);
    ASSERT(get_proc_id_from_cmp_addr(va),
           mem_map_entry_traversal_done(traversal));
  }
}
static inline void mem_map_entry_traversal_init ( Mem_Map_Traversal * traversal , Addr va , uns size ) { Addr last_va = ADDR_PLUS_OFFSET ( va , size - 1 ) ; traversal -> first_entry_addr = MEM_MAP_ENTRY_ADDR ( va ) ; traversal -> last_entry_addr = MEM_MAP_ENTRY_ADDR ( last_va ) ; traversal -> entry_addr = traversal -> first_entry_addr ; traversal -> first_entry_first_byte = MEM_MAP_BYTE_IN_ENTRY ( va ) ; traversal -> last_entry_last_byte = MEM_MAP_BYTE_IN_ENTRY ( last_va ) ; if ( 0 == size ) { traversal -> entry_addr = ADDR_PLUS_OFFSET ( traversal -> last_entry_addr , MEM_MAP_ENTRY_SIZE ) ; ASSERT ( get_proc_id_from_cmp_addr ( va ) , mem_map_entry_traversal_done ( traversal ) ) ; } }
map_mem_*_traversal_*: these functions traverse the memory map
entries and bytes within those entries given an access with an
address and size.
map_mem_ * _traversal_ * : these functions traverse the memory map entries and bytes within those entries given an access with an address and size .
// last byte in access // special case - if the size is 0, we shouldn't do a traversal at all, so // force the traversal to be "done"