![]() |
The ROme OpTimistic Simulator
2.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
|
Dynamic Memory Logger and Restorer (DyMeLoR) More...
Go to the source code of this file.
Functions | |
static void | malloc_area_init (malloc_area *m_area, size_t size, int num_chunks) |
malloc_state * | malloc_state_init (void) |
void | malloc_state_wipe (malloc_state **state_ptr) |
static size_t | compute_size (size_t size) |
static void | find_next_free (malloc_area *m_area) |
void * | do_malloc (struct lp_struct *lp, size_t size) |
void | do_free (struct lp_struct *lp, void *ptr) |
void | dirty_mem (void *base, int size) |
size_t | get_log_size (malloc_state *logged_state) |
void * | __wrap_malloc (size_t size) |
void | __wrap_free (void *ptr) |
void * | __wrap_realloc (void *ptr, size_t size) |
void * | __wrap_calloc (size_t nmemb, size_t size) |
void | clean_buffers_on_gvt (struct lp_struct *lp, simtime_t time_barrier) |
Dynamic Memory Logger and Restorer (DyMeLoR)
LP's memory manager.
This file is part of ROOT-Sim (ROme OpTimistic Simulator).
ROOT-Sim is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; only version 3 of the License applies.
ROOT-Sim is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with ROOT-Sim; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Definition in file dymelor.c.
void* __wrap_calloc | ( | size_t | nmemb, |
size_t | size | ||
) |
This is the wrapper of the real stdlib calloc(). Whenever the application level software calls calloc, the call is redirected to this piece of code which relies on wrap_malloc
nmemb | The number of elements to be allocated |
size | The size of each allocated member |
Definition at line 677 of file dymelor.c.
void __wrap_free | ( | void * | ptr | ) |
This is the wrapper of the real stdlib free(). Whenever the application level software calls free, the call is redirected to this piece of code which will set the chunk in the corresponding malloc_area as not allocated.
For further information, please see the paper: R. Toccaceli, F. Quaglia DyMeLoR: Dynamic Memory Logger and Restorer Library for Optimistic Simulation Objects with Generic Memory Layout Proceedings of the 22nd Workshop on Principles of Advanced and Distributed Simulation 2008
ptr | A memory buffer to be free'd |
Definition at line 602 of file dymelor.c.
void* __wrap_malloc | ( | size_t | size | ) |
This is the wrapper of the real stdlib malloc(). Whenever the application level software calls malloc, the call is redirected to this piece of code which uses the memory preallocated by the DyMeLoR subsystem for serving the request. If the memory in the malloc_area is exhausted, a new one is created, relying on the stdlib malloc. In future releases, this wrapper will be integrated with the Memory Management subsystem, which is not yet ready for production.
size | Size of the allocation |
Definition at line 566 of file dymelor.c.
void* __wrap_realloc | ( | void * | ptr, |
size_t | size | ||
) |
This is the wrapper of the real stdlib realloc(). Whenever the application level software calls realloc, the call is redirected to this piece of code which rely on wrap_malloc
ptr | The pointer to be buffer to be reallocated |
size | The size of the allocation |
Definition at line 628 of file dymelor.c.
|
static |
void dirty_mem | ( | void * | base, |
int | size | ||
) |
This function marks a memory chunk as dirty. It is invoked from assembly modules invoked by calls injected by the instrumentor, and from the third-party library wrapper. Invocations from other parts of the kernel should be handled with great care.
base | The initial to the start address of the update |
size | The number of bytes being updated |
void* do_malloc | ( | struct lp_struct * | lp, |
size_t | size | ||
) |
|
static |
Find the smallest idx associated with a free chunk in a given malloc_area. This function tries to keep the chunks clustered in the beginning of the malloc_area, so to enchance locality
m_area | The malloc_area to scan in order to find the next available chunk |
Definition at line 159 of file dymelor.c.
size_t get_log_size | ( | malloc_state * | logged_state | ) |
|
static |
malloc_state* malloc_state_init | ( | void | ) |