Public Member Functions | |
mmap_ctrl (int aFilDes, const visitor &aVisit, size_t aPagSiz) | |
bool | not_empty (void) const |
Private Attributes | |
bool | _notEmpty |
Tells whether data were copied or not. | |
Classes | |
class | segment |
rpa::mmap_ctrl::mmap_ctrl | ( | int | aFilDes, | |
const visitor & | aVisit, | |||
size_t | aPagSiz | |||
) | [inline] |
The size to be mapped in memory may be too big, so it is splitted in a loop, and the functor is called for each segment.
The length argument of mmap has no size or alignment constraints.
The offset argument is constrained to be aligned and sized according to the value returned by sysconf when passed _SC_PAGESIZE or _SC_PAGE_SIZE. Anyway, the data starts from the beginning.
If the segment size is too big, it would be wise to shrink it and retry. Conversely, it may be good to gradually increase it.
If an exception is thrown, the segment will be unmapped.
bool rpa::mmap_ctrl::not_empty | ( | void | ) | const [inline] |
bool rpa::mmap_ctrl::_notEmpty [private] |
Tells whether data were copied or not.