FACT++  1.0
void Memory::free ( void *  mem)

Definition at line 126 of file EventBuilder.cc.

References g_maxMem, and MAX_TOT_MEM.

Referenced by Readline::AddToHistory(), cancel_pop_up(), cleanUp(), client_info(), command_handler(), createBenchmark(), createMemoryNode(), delete_browser(), delete_curr_service(), deleteCharItemList(), deleteIntItemList(), deleteItemList(), dic_get_server_services(), did_prepare_command(), dim_dtq_stop(), dis_get_client_services(), dis_get_next_cmnd(), dis_insert_request(), dis_remove_service(), dis_send_service(), dis_set_buffer_size(), do_cmnd_callback(), do_dis_add_service_dns(), do_dna_write(), do_exit_handler(), do_got_service_list(), dtq_delete(), dtq_rem_entry(), enable_sig(), execute_command(), execute_service(), fillCharItem(), fillIntItem(), fillItem(), findSmiServices(), freeMemoryNode(), get_new_dns_server_info(), get_something(), getDeadband(), got_service_list(), got_update_services(), got_update_smi_objects(), handle_client_request(), handle_dns_info(), handle_registration(), inform_clients(), Java_dim_MutableMemory_releaseNativeDataBlock(), Java_dim_ObjectDescriptor_deleteObjectDescriptor(), leaveCommandHandler(), modify_service(), prepareJSONServiceList(), prepareJSONSmiObjectList(), prepareJSONSmiTree(), prepareJSONTree(), Readline::Prompt(), Readline::PromptEOF(), publish(), publishChar(), publishInt(), recv_service_info(), release_all_requests(), release_conn(), release_request(), release_service(), rem_deleted_entries(), rem_exit_handler_item(), request_command(), scan_it(), send_command(), send_dns_server_info(), service_info(), service_remove(), set_rpc_info(), set_something(), setDeadband(), show_clients(), start(), Readline::StaticPrompt(), unescape(), update_servers(), update_show_servers(), updateFeeService(), and EVT_CTRL2::~EVT_CTRL2().

127  {
128  if (!mem)
129  return;
130 
131  // Decrease the amont of memory in use accordingly
132  inuse -= MAX_TOT_MEM;
133 
134  // If the maximum memory has changed, we might be over the limit.
135  // In this case: free a slot
136  if (allocated>g_maxMem)
137  {
138  delete [] (char*)mem;
140  return;
141  }
142 
143  const std::lock_guard<std::mutex> lock(mtx);
144  memory.push_front(mem);
145  }
std::mutex mtx
Definition: EventBuilder.cc:95
std::forward_list< void * > memory
Definition: EventBuilder.cc:97
size_t g_maxMem
Definition: EventBuilder.cc:76
uint64_t inuse
Definition: EventBuilder.cc:90
uint64_t allocated
Definition: EventBuilder.cc:91
#define MAX_TOT_MEM
Definition: EventBuilder.h:96