PERL CVS PARROT 24 CVS COMMIT PARROT SRC HASH C LIST C
Date: 25 Feb 2005 08:40:55 -0000

Subject: cvs commit: parrot/src hash.c list.c
From: leo@no-spam (Leopold Toetsch)

cvsuser 05/02/25 00:40:55

Modified: src hash.c list.c Log:
GMS generational MS 8 - more fixes * add wrte barriers for list and hash buffers * down at 28 failing tests Revision Changes Path 1.88 +12 -1 parrot/src/hash.c Index: hash.c ===================================================================
RCS file: /cvs/public/parrot/src/hash.c,v retrieving revision 1.87
retrieving revision 1.88
diff -u -r1.87 -r1.88
--- hash.c 25 Jan 2005 14:47:33 -0000 1.87
+++ hash.c 25 Feb 2005 08:40:54 -0000 1.88
@@no-spam -1,6 +1,6 @@no-spam /*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-$Id: hash.c,v 1.87 2005/01/25 14:47:33 leo Exp $
+$Id: hash.c,v 1.88 2005/02/25 08:40:54 leo Exp $
=head1 NAME @@no-spam -437,6 +437,17 @@no-spam Parrot_reallocate(interpreter, hash->bucket_pool,
new_pool_size * sizeof(HashBucket));
+ if (hash->container) {
+ /* resizing an existing hash has the same DOD effect as + * storing a new value into a possibly old aggregate + *
+ * Yeah, that's ugly. We should get rid of the buffers + * in hash and use e.g. perl5's hash scheme + */
+ DOD_WRITE_BARRIER(interpreter, hash->container, 0, hash);
+ DOD_WRITE_BARRIER(interpreter, hash->container, 0, hash->bucket_pool);

+ }
+
/* Add the newly allocated buckets onto the free list */
for (bi = old_pool_size; bi < new_pool_size; bi++) {
bucket = getBucket(hash, bi);
1.53 +15 -2 parrot/src/list.c Index: list.c ===================================================================
RCS file: /cvs/public/parrot/src/list.c,v retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- list.c 19 Aug 2004 13:46:14 -0000 1.52
+++ list.c 25 Feb 2005 08:40:55 -0000 1.53
@@no-spam -1,7 +1,7 @@no-spam /*
Copyright: (c) 2002 Leopold Toetsch <lt@no-spam>
License: Artistic/GPL, see README and LICENSES for details -$Id: list.c,v 1.52 2004/08/19 13:46:14 leo Exp $
+$Id: list.c,v 1.53 2005/02/25 08:40:55 leo Exp $
=head1 NAME @@no-spam -238,6 +238,9 @@no-spam chunk->next = NULL;
chunk->prev = NULL;
Parrot_allocate_zeroed(interpreter, (Buffer *)chunk, size);
+ /* see also src/hash.c */
+ if (list->container)
+ DOD_WRITE_BARRIER(interpreter, list->container, 0, chunk);
Parrot_unblock_DOD(interpreter);
/*Parrot_unblock_GC(interpreter); */
return chunk;
@@no-spam -400,7 +403,9 @@no-spam * TODO test the logic that solves the above problem */
if(prev->items + chunk->items > MAX_ITEMS) {
Parrot_reallocate(interpreter, (Buffer *)prev,
- MAX_ITEMS * list->item_size);
+ MAX_ITEMS * list->item_size);
+ if (list->container)
+ DOD_WRITE_BARRIER(interpreter, list->container, 0, prev);

mem_sys_memmove(
(char *) PObj_bufstart(&prev->data) +
prev->items * list->item_size,
@@no-spam -417,6 +422,8 @@no-spam else {
Parrot_reallocate(interpreter, (Buffer *)prev,
(prev->items + chunk->items) * list->item_size);
+ if (list->container)
+ DOD_WRITE_BARRIER(interpreter, list->container, 0, prev);

mem_sys_memmove(
(char *) PObj_bufstart(&prev->data) +
prev->items * list->item_size,
@@no-spam -502,6 +509,8 @@no-spam len = 4;
Parrot_reallocate(interpreter, (Buffer *)list,
len * sizeof(List_chunk *));
+ if (list->container)
+ DOD_WRITE_BARRIER(interpreter, list->container, 0, list);
list->collect_runs = interpreter->arena_base->collect_runs;
}
@@no-spam -932,6 +941,8 @@no-spam /* it fits, just allocate */
Parrot_reallocate(interpreter, (Buffer *)chunk,
chunk->items * list->item_size);
+ if (list->container)
+ DOD_WRITE_BARRIER(interpreter, list->container, 0, chunk);
chunk->flags |= no_power_2;
chunk->flags &= ~sparse;
}
@@no-spam -944,6 +955,8 @@no-spam chunk->items = n2;
Parrot_reallocate(interpreter, (Buffer *)chunk,
chunk->items * list->item_size);
+ if (list->container)
+ DOD_WRITE_BARRIER(interpreter, list->container, 0, chunk);
chunk->flags &= ~sparse;
if (n3) {
new_chunk = allocate_chunk(interpreter, list, n3, list->item_size);