CodeSonar C++ API
[For improved navigation, enable JavaScript.]
Static Public Member Functions | List of all members
cs::object_pager Class Reference

Management for IO buffering. More...

Static Public Member Functions

static void flush ()
 Flush managed objects to disk. More...
 
static size_t get_capacity ()
 Get the number of bytes of managed objects that can be kept in memory. More...
 
static size_t get_current_io_buffer_capacity ()
 Get the number of bytes currently allocated for IO buffering. More...
 
static size_t get_pending_io_buffer_capacity ()
 Get the IO buffer capacity specified in the last set_io_buffer_capacity() call. More...
 
static void set_capacity (size_t s)
 Alter the number of bytes of managed objects that can be kept in memory. More...
 
static void set_io_buffer_capacity (size_t s)
 Set the number of bytes to allocate for IO buffering. More...
 

Detailed Description

Management for IO buffering.

You do not need to instantiate this class: all members are static.

Member Function Documentation

◆ flush()

static void cs::object_pager::flush ( )
inlinestatic

Flush managed objects to disk.

Returns
void

Calling this function will free all managed objects from memory and write them to disk. It is illegal to call this function with certain types of outstanding iterators. An assertion of very limited usefulness will fire if you do so.

◆ get_capacity()

static size_t cs::object_pager::get_capacity ( )
inlinestatic

Get the number of bytes of managed objects that can be kept in memory.

Returns
The number of bytes of managed objects that can be kept in memory at any time.

◆ get_current_io_buffer_capacity()

static size_t cs::object_pager::get_current_io_buffer_capacity ( )
inlinestatic

Get the number of bytes currently allocated for IO buffering.

Returns
The number of bytes currently allocated for IO buffering.
Exceptions
result::ERROR_SDG_NOT_PRESENTif no allocation has been done.

◆ get_pending_io_buffer_capacity()

static size_t cs::object_pager::get_pending_io_buffer_capacity ( )
inlinestatic

Get the IO buffer capacity specified in the last set_io_buffer_capacity() call.

Returns
The number of bytes allocated for IO buffering.

◆ set_capacity()

static void cs::object_pager::set_capacity ( size_t  s)
inlinestatic

Alter the number of bytes of managed objects that can be kept in memory.

Parameters
[in]sThe number of bytes of managed objects that can be kept resident.
Returns
void

A reasonable setting might be 1024*1024*256. This should probably not exceed 0.75 * min(RAM_SIZE,2GB). Setting this value too low can cause thrashing, but might be desirable if your algorithm has good access patterns or needs to use the memory for other purposes.

If called with a value less than the current number of bytes in use by resident objects, then objects will be paged out immediately.

◆ set_io_buffer_capacity()

static void cs::object_pager::set_io_buffer_capacity ( size_t  s)
inlinestatic

Set the number of bytes to allocate for IO buffering.

Parameters
[in]sThe number of bytes to allocate for IO buffering.
Returns
void

A reasonable setting might be 1024*1024*128: 268435456

  • Too low a value may cause thrashing. - Too high a value may cause the tool to exhaust virtual address space.

The new value does not take effect until the next time project::load() is called.


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