* src/mm/cacao-gc/region.c (region_create): Header mentioned above is initiated.
* src/mm/cacao-gc/heap.c (heap_alloc_intern): Lock regions while allocating.
--HG--
branch : exact-gc
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
dnl 02110-1301, USA.
dnl
-dnl $Id: configure.ac 7441 2007-03-02 23:13:10Z michi $
+dnl $Id: configure.ac 7434 2007-03-02 19:44:53Z edwin $
dnl Process this file with autoconf to produce a configure script.
/* align objects in memory */
bytelength = GC_ALIGN(bytelength, GC_ALIGN_SIZE);
+ /* lock the region */
+ LOCK_MONITOR_ENTER(region);
+
/* check for sufficient free space */
if (bytelength > region->free) {
dolog("GC: Region out of memory!");
- /* TODO: change this to gc_collect() !!! */
- /*gc_call();*/
+ gc_collect();
return NULL;
}
region->ptr += bytelength;
region->free -= bytelength;
+ /* unlock the region */
+ LOCK_MONITOR_EXIT(region);
+ GC_LOG( region = NULL; );
+
/* clear allocated memory region */
GC_ASSERT(p);
MSET(p, 0, u1, bytelength);
region->size = size;
region->free = size;
+#if defined(ENABLE_THREADS)
+ /* initiate the header for locking */
+ lock_init_object_lock((java_objectheader *) region);
+#endif
+
#if defined(ENABLE_MEMCHECK)
/* poison this region */
/* TODO: this should really be done MNEW above! */
/* Structures *****************************************************************/
struct regioninfo_t {
+#if defined(ENABLE_THREADS)
+ java_objectheader header; /* needed for locking */
+#endif
u1 *base; /* pointer to the start of this region */
u1 *end; /* pointer to the end of this region */
u1 *ptr; /* pointer to the beginning of the free space */
calls instead of machine instructions, using the C calling
convention.
- $Id: builtin.c 7483 2007-03-08 13:17:40Z michi $
+ $Id: builtin.c 7459 2007-03-05 17:34:43Z edwin $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: patcher.c 7483 2007-03-08 13:17:40Z michi $
+ $Id: patcher.c 7464 2007-03-06 00:26:31Z edwin $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: jit.c 7483 2007-03-08 13:17:40Z michi $
+ $Id: jit.c 7451 2007-03-04 20:10:18Z edwin $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: jit.h 7483 2007-03-08 13:17:40Z michi $
+ $Id: jit.h 7464 2007-03-06 00:26:31Z edwin $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: md.c 7483 2007-03-08 13:17:40Z michi $
+ $Id: md.c 7477 2007-03-07 14:05:04Z twisti $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: patcher.c 7483 2007-03-08 13:17:40Z michi $
+ $Id: patcher.c 7464 2007-03-06 00:26:31Z edwin $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: parse.c 7483 2007-03-08 13:17:40Z michi $
+ $Id: parse.c 7464 2007-03-06 00:26:31Z edwin $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: patcher.c 7483 2007-03-08 13:17:40Z michi $
+ $Id: patcher.c 7464 2007-03-06 00:26:31Z edwin $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: patcher.c 7483 2007-03-08 13:17:40Z michi $
+ $Id: patcher.c 7464 2007-03-06 00:26:31Z edwin $
*/
Changes: Edwin Steiner
- $Id: asmpart.S 7483 2007-03-08 13:17:40Z michi $
+ $Id: asmpart.S 7442 2007-03-02 23:28:37Z pm $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: asmpart.S 7483 2007-03-08 13:17:40Z michi $
+ $Id: asmpart.S 7475 2007-03-07 12:37:34Z twisti $
*/