/* src/mm/dumpmemory.c - dump memory management
Copyright (C) 1996-2005, 2006, 2007, 2008
- CACAOVM - Verein zu Foerderung der freien virtuellen Machine CACAO
+ CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
This file is part of CACAO.
#include "mm/dumpmemory.h"
#include "mm/memory.h"
-#include "threads/threads-common.h"
+#include "threads/thread.h"
#include "vmcore/options.h"
NULL iff `size` was zero
ERROR HANDLING:
- XXX This function uses `memory_checked_alloc`, which *exits* if no
- memory could be allocated.
+ XXX This function uses `memory_checked_alloc`, which *exits* if
+ no memory could be allocated.
THREADS:
- dump_alloc is thread safe. Each thread has its own dump memory area.
+ dumpmemory_get is thread safe. Each thread has its own dump
+ memory area.
This function is a fast allocator suitable for scratch memory that
can be collectively freed when the current activity (eg. compiling)
You cannot selectively free dump memory. Before you start
allocating it, you remember the current size returned by
- `dump_size`. Later, when you no longer need the memory, call
- `dump_release` with the remembered size and all dump memory
- allocated since the call to `dump_size` will be freed.
+ `dumpmemory_marker`. Later, when you no longer need the memory,
+ call `dumpmemory_release` with the remembered size and all dump
+ memory allocated since the call to `dumpmemory_marker` will be
+ freed.
*******************************************************************************/
}
-/* dump_release ****************************************************************
+/* dumpmemory_release **********************************************************
Release dump memory above the given size.
IN:
size........All dump memory above this mark will be freed. Usually
- `size` will be the return value of a `dump_size` call
- made earlier.
+ `size` will be the return value of a `dumpmemory_marker`
+ call made earlier.
ERROR HANDLING:
XXX If the given size is invalid, this function *exits* with an
*******************************************************************************/
-void dump_release(s4 size)
+void dumpmemory_release(s4 size)
{
#if defined(DISABLE_DUMP)
}
-/* dump_size *******************************************************************
+/* dumpmemory_marker ***********************************************************
- Return the current size of the dump memory area. See `dump_alloc`.
+ Returns a marker of the dump memory area. This marker is actually
+ the used size of the dump memory area.
+
+ RETURN VALUE:
+ marker of the current dump memory status
*******************************************************************************/
-s4 dump_size(void)
+int32_t dumpmemory_marker(void)
{
#if defined(DISABLE_DUMP)
/* use malloc memory for dump memory (for debugging only!) */