scc
2022.4.0
SystemC components library
|
a sparse array suitable for large sizes More...
#include <sparse_array.h>
Public Types | |
using | page_type = std::array< T, 1<< PAGE_ADDR_BITS > |
Public Member Functions | |
sparse_array () | |
~sparse_array () | |
T & | operator[] (uint32_t addr) |
page_type & | operator() (uint32_t page_nr) |
bool | is_allocated (uint32_t addr) |
uint64_t | size () |
Protected Attributes | |
std::array< page_type *, SIZE/(1<< PAGE_ADDR_BITS)+1 > | arr |
a sparse array suitable for large sizes
a simple array which allocates memory in configurable chunks (size of 2^PAGE_ADDR_BITS), used for large sparse arrays. Memory is allocated on demand
Definition at line 36 of file sparse_array.h.
|
inline |
the default constructor
Definition at line 52 of file sparse_array.h.
|
inline |
the destructor
Definition at line 56 of file sparse_array.h.
|
inline |
check if page for address is allocated
addr | the address to check |
Definition at line 91 of file sparse_array.h.
|
inline |
page fetch operator
page_nr | the page number ot fetch |
Definition at line 79 of file sparse_array.h.
|
inline |
element access operator
addr | address to access |
Definition at line 66 of file sparse_array.h.
|
inline |