Otawa  0.10
otawa::MemBlockMap< T > Class Template Reference

This class is used to retrieve quickly blocks from their containing address. More...

#include <otawa/util/MemBlockMap.h>

Classes

struct  node_t
 

Public Member Functions

 MemBlockMap (ot::size block_size=32, t::size table_size=211)
 Build a memory block map. More...
 
 ~MemBlockMap (void)
 
void clear (void)
 Clear the content of map. More...
 
void add (const T *block)
 Add a block to the map. More...
 
const T * get (Address address)
 Find a block by its address. More...
 

Private Types

typedef struct
otawa::MemBlockMap::node_t 
node_t
 

Private Attributes

ot::size pow
 
ot::size bsize
 
ot::size tsize
 
node_t ** nodes
 

Detailed Description

template<class T>
class otawa::MemBlockMap< T >

This class is used to retrieve quickly blocks from their containing address.

Stored blocks must match the Block concept of OTAWA:

class Block {
public:
Address address(void) const;
Address topAddress(void) const;
size_t size(void) const;
};
Parameters
TType of stored memory blocks.
Author
H. Cassé casse.nosp@m.@iri.nosp@m.t.fr

Member Typedef Documentation

template<class T>
typedef struct otawa::MemBlockMap::node_t otawa::MemBlockMap< T >::node_t
private

Constructor & Destructor Documentation

template<class T>
otawa::MemBlockMap< T >::MemBlockMap ( ot::size  block_size = 32,
t::size  table_size = 211 
)
inline

Build a memory block map.

Parameters
block_sizeAverage size of the stored blocks.
table_sizeHash table size (better if it is a prime number).
template<class T>
otawa::MemBlockMap< T >::~MemBlockMap ( void  )
inline

Member Function Documentation

template<class T>
void otawa::MemBlockMap< T >::add ( const T *  block)
inline

Add a block to the map.

Parameters
blockBlock to add.
template<class T>
void otawa::MemBlockMap< T >::clear ( void  )
inline

Clear the content of map.

Referenced by otawa::MemBlockMap< otawa::BasicBlock >::~MemBlockMap().

template<class T>
const T & otawa::MemBlockMap< T >::get ( Address  address)
inline

Find a block by its address.

Parameters
addressAddress of the block to get.
Returns
Block matching the address or null if none is found.

Member Data Documentation

template<class T>
ot::size otawa::MemBlockMap< T >::bsize
private

The documentation for this class was generated from the following files: