[svn:parrot] r49035 - branches/gc_massacre/src/gc
mikehh at svn.parrot.org
mikehh at svn.parrot.org
Thu Sep 16 08:04:02 UTC 2010
Author: mikehh
Date: Thu Sep 16 08:04:02 2010
New Revision: 49035
URL: https://trac.parrot.org/parrot/changeset/49035
Log:
[gc_massacre] fix codetest failures - add missing ASSERT_ARGS,
add some missing c_function_docs and fix some and fix
there should be at least one space between a C keyword
and any subsequent open parenthesis (left c++ comments)
Modified:
branches/gc_massacre/src/gc/gc_ms2.c
Modified: branches/gc_massacre/src/gc/gc_ms2.c
==============================================================================
--- branches/gc_massacre/src/gc/gc_ms2.c Thu Sep 16 07:45:51 2010 (r49034)
+++ branches/gc_massacre/src/gc/gc_ms2.c Thu Sep 16 08:04:02 2010 (r49035)
@@ -1255,7 +1255,7 @@
/*
-=item C<void gc_ms2_pmc_needs_early_collection(PARROT_INTERP, PMC *pmc)>
+=item C<static void gc_ms2_pmc_needs_early_collection(PARROT_INTERP, PMC *pmc)>
Mark a PMC as needing timely destruction
@@ -1273,7 +1273,7 @@
/*
-=item C<void gc_ms2_maybe_mark_and_sweep()>
+=item C<static void gc_ms2_maybe_mark_and_sweep(PARROT_INTERP)>
Maybe M&S. Depends on total allocated memory, memory allocated since last alloc
and phase of the Moon.
@@ -1284,6 +1284,8 @@
static void
gc_ms2_maybe_mark_and_sweep(PARROT_INTERP)
{
+ ASSERT_ARGS(gc_ms2_maybe_mark_and_sweep)
+
MarkSweep_GC *self = (MarkSweep_GC *)interp->gc_sys->gc_private;
/* Collect every 256M. Hardcode for now. Will be configured via CLI */
@@ -1292,9 +1294,22 @@
}
}
+/*
+
+=item C<static size_t gc_ms2_count_used_string_memory(PARROT_INTERP, Linked_List
+*list)>
+
+find amount of used string memory
+
+=cut
+
+*/
+
static size_t
gc_ms2_count_used_string_memory(PARROT_INTERP, ARGIN(Linked_List *list))
{
+ ASSERT_ARGS(gc_ms2_count_used_string_memory)
+
size_t total_amount = 0;
List_Item_Header *tmp = list->first;
@@ -1304,8 +1319,8 @@
STRING *str = (STRING*)obj;
/* Header size */
- total_amount += sizeof(List_Item_Header)
- + sizeof(STRING*);
+ total_amount += sizeof (List_Item_Header)
+ + sizeof (STRING*);
total_amount += str->bufused;
tmp = next;
@@ -1314,9 +1329,22 @@
return total_amount;
}
+/*
+
+=item C<static size_t gc_ms2_count_used_pmc_memory(PARROT_INTERP, Linked_List
+*list)>
+
+find amount of used pmc memory
+
+=cut
+
+*/
+
static size_t
gc_ms2_count_used_pmc_memory(PARROT_INTERP, ARGIN(Linked_List *list))
{
+ ASSERT_ARGS(gc_ms2_count_used_pmc_memory)
+
size_t total_amount = 0;
List_Item_Header *tmp = list->first;
@@ -1325,8 +1353,8 @@
PMC *obj = LLH2Obj_typed(tmp, PMC);
/* Header size */
- total_amount += sizeof(List_Item_Header)
- + sizeof(PMC*);
+ total_amount += sizeof (List_Item_Header)
+ + sizeof (PMC*);
total_amount += obj->vtable->attr_size;
tmp = next;
More information about the parrot-commits
mailing list