28 #ifndef MEM_CLUSTER_HPP 29 #define MEM_CLUSTER_HPP 31 #include "../my_config.h" 42 class mem_cluster :
public mem_allocator
45 mem_cluster(U_I x_block_size,
47 mem_manager *x_holder);
48 mem_cluster(
const mem_cluster & ref): mem_allocator(ref) {
throw SRC_BUG; };
49 const mem_cluster & operator = (
const mem_cluster & ref) {
throw SRC_BUG; };
53 bool is_full()
const {
return available_blocks == 0; };
56 bool is_empty()
const {
return available_blocks == max_available_blocks; };
62 U_I get_block_size()
const {
return block_size; };
65 std::string dump()
const;
68 virtual void release(
void *ptr);
70 #ifdef LIBDAR_DEBUG_MEMORY 71 virtual U_I max_percent_full()
const {
return (max_available_blocks - min_avail_reached)*100/max_available_blocks; };
73 virtual U_I max_percent_full()
const {
return 0; };
77 static const U_64 FULL = ~(U_64)(0);
78 static const U_64 HALF = (~(U_64)(0)) >> 1;
79 static const U_64 LEAD = ~((~(U_64)(0)) >> 1);
91 U_I next_free_in_table;
93 U_I max_available_blocks;
94 #ifdef LIBDAR_DEBUG_MEMORY 95 U_I min_avail_reached;
98 U_I find_free_slot_in(U_I table_integer)
const;
99 void set_slot_in(U_I table_integer, U_I bit_offset,
bool value);
100 std::string examination_status()
const;
this is the base class of object that can provide dynamically allocated memory blocks ...
libdar namespace encapsulate all libdar symbols