[svn:parrot] r47454 - in branches/gc_massacre: include/parrot src src/gc
cotto at svn.parrot.org
cotto at svn.parrot.org
Tue Jun 8 07:35:31 UTC 2010
Author: cotto
Date: Tue Jun 8 07:35:31 2010
New Revision: 47454
URL: https://trac.parrot.org/parrot/changeset/47454
Log:
[list] function renaming to make the list code look more separate from gc
Modified:
branches/gc_massacre/include/parrot/list.h
branches/gc_massacre/src/gc/gc_ms.c
branches/gc_massacre/src/gc/gc_ms2.c
branches/gc_massacre/src/gc/gc_tms.c
branches/gc_massacre/src/list.c
Modified: branches/gc_massacre/include/parrot/list.h
==============================================================================
--- branches/gc_massacre/include/parrot/list.h Tue Jun 8 07:15:52 2010 (r47453)
+++ branches/gc_massacre/include/parrot/list.h Tue Jun 8 07:35:31 2010 (r47454)
@@ -97,15 +97,15 @@
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
-struct Linked_List* Parrot_gc_allocate_linked_list(SHIM_INTERP);
+struct Linked_List* Parrot_list_new(SHIM_INTERP);
PARROT_EXPORT
-void Parrot_gc_destroy_linked_list(SHIM_INTERP, ARGMOD(Linked_List* list))
+void Parrot_list_destroy(SHIM_INTERP, ARGMOD(Linked_List* list))
__attribute__nonnull__(2)
FUNC_MODIFIES(* list);
PARROT_EXPORT
-void Parrot_gc_list_append(SHIM_INTERP,
+void Parrot_list_append(SHIM_INTERP,
ARGMOD(Linked_List *list),
ARGMOD(List_Item_Header *item))
__attribute__nonnull__(2)
@@ -114,13 +114,13 @@
FUNC_MODIFIES(*item);
PARROT_EXPORT
-List_Item_Header* Parrot_gc_list_pop(PARROT_INTERP,
+List_Item_Header* Parrot_list_pop(PARROT_INTERP,
ARGIN(Linked_List *list))
__attribute__nonnull__(1)
__attribute__nonnull__(2);
PARROT_EXPORT
-List_Item_Header* Parrot_gc_list_remove(SHIM_INTERP,
+List_Item_Header* Parrot_list_remove(SHIM_INTERP,
ARGMOD(Linked_List *list),
ARGMOD(List_Item_Header *item))
__attribute__nonnull__(2)
@@ -128,31 +128,31 @@
FUNC_MODIFIES(*list)
FUNC_MODIFIES(*item);
-int Parrot_gc_list_check(SHIM_INTERP, ARGIN(Linked_List *list))
+int Parrot_list_check(SHIM_INTERP, ARGIN(Linked_List *list))
__attribute__nonnull__(2);
-int Parrot_gc_list_is_owned(SHIM_INTERP,
+int Parrot_list_contains(SHIM_INTERP,
ARGIN(Linked_List *list),
ARGIN(List_Item_Header *item))
__attribute__nonnull__(2)
__attribute__nonnull__(3);
-#define ASSERT_ARGS_Parrot_gc_allocate_linked_list \
+#define ASSERT_ARGS_Parrot_list_new \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
-#define ASSERT_ARGS_Parrot_gc_destroy_linked_list __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+#define ASSERT_ARGS_Parrot_list_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(list))
-#define ASSERT_ARGS_Parrot_gc_list_append __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+#define ASSERT_ARGS_Parrot_list_append __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(list) \
, PARROT_ASSERT_ARG(item))
-#define ASSERT_ARGS_Parrot_gc_list_pop __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+#define ASSERT_ARGS_Parrot_list_pop __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(list))
-#define ASSERT_ARGS_Parrot_gc_list_remove __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+#define ASSERT_ARGS_Parrot_list_remove __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(list) \
, PARROT_ASSERT_ARG(item))
-#define ASSERT_ARGS_Parrot_gc_list_check __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+#define ASSERT_ARGS_Parrot_list_check __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(list))
-#define ASSERT_ARGS_Parrot_gc_list_is_owned __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+#define ASSERT_ARGS_Parrot_list_contains __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(list) \
, PARROT_ASSERT_ARG(item))
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
Modified: branches/gc_massacre/src/gc/gc_ms.c
==============================================================================
--- branches/gc_massacre/src/gc/gc_ms.c Tue Jun 8 07:15:52 2010 (r47453)
+++ branches/gc_massacre/src/gc/gc_ms.c Tue Jun 8 07:35:31 2010 (r47454)
@@ -463,7 +463,7 @@
interp->gc_sys->get_gc_info = gc_ms_get_gc_info;
/* gc_private is @objects */
- interp->gc_sys->gc_private = Parrot_gc_allocate_linked_list(interp);
+ interp->gc_sys->gc_private = Parrot_list_new(interp);
initialize_var_size_pools(interp, interp->mem_pools);
initialize_fixed_size_pools(interp, interp->mem_pools);
Modified: branches/gc_massacre/src/gc/gc_ms2.c
==============================================================================
--- branches/gc_massacre/src/gc/gc_ms2.c Tue Jun 8 07:15:52 2010 (r47453)
+++ branches/gc_massacre/src/gc/gc_ms2.c Tue Jun 8 07:35:31 2010 (r47454)
@@ -597,11 +597,11 @@
self->pmc_allocator = Parrot_gc_create_pool_allocator(
sizeof (List_Item_Header) + sizeof (PMC));
- self->objects = Parrot_gc_allocate_linked_list(interp);
+ self->objects = Parrot_list_new(interp);
self->string_allocator = Parrot_gc_create_pool_allocator(
sizeof (List_Item_Header) + sizeof (STRING));
- self->strings = Parrot_gc_allocate_linked_list(interp);
+ self->strings = Parrot_list_new(interp);
/* Arbitary number */
self->gc_theshold = 4096 * 100;
@@ -642,7 +642,7 @@
if (pmc) {
if (PObj_on_free_list_TEST(pmc))
return;
- Parrot_gc_list_remove(interp, self->objects, Obj2LLH(pmc));
+ Parrot_list_remove(interp, self->objects, Obj2LLH(pmc));
PObj_on_free_list_SET(pmc);
Parrot_pmc_destroy(interp, pmc);
@@ -755,7 +755,7 @@
if (s) {
if (PObj_on_free_list_TEST(s))
return;
- Parrot_gc_list_remove(interp, self->strings, Obj2LLH(s));
+ Parrot_list_remove(interp, self->strings, Obj2LLH(s));
PObj_on_free_list_SET(s);
if (Buffer_bufstart(s) && !PObj_external_TEST(s))
@@ -935,7 +935,7 @@
return 0;
/* Pool.is_owned isn't precise enough (yet) */
- if (Parrot_gc_list_is_owned(interp, list, item))
+ if (Parrot_list_contains(interp, list, item))
return 1;
return 0;
Modified: branches/gc_massacre/src/gc/gc_tms.c
==============================================================================
--- branches/gc_massacre/src/gc/gc_tms.c Tue Jun 8 07:15:52 2010 (r47453)
+++ branches/gc_massacre/src/gc/gc_tms.c Tue Jun 8 07:35:31 2010 (r47454)
@@ -576,7 +576,7 @@
self->constant_pmc_allocator = Parrot_gc_create_pool_allocator(
sizeof (List_Item_Header) + sizeof (PMC));
- self->objects = Parrot_gc_allocate_linked_list(interp);
+ self->objects = Parrot_list_new(interp);
}
interp->gc_sys->gc_private = self;
@@ -619,7 +619,7 @@
if (pmc) {
if (PObj_on_free_list_TEST(pmc))
return;
- Parrot_gc_list_remove(interp, self->objects, Obj2LLH(pmc));
+ Parrot_list_remove(interp, self->objects, Obj2LLH(pmc));
PObj_on_free_list_SET(pmc);
Parrot_gc_pool_free(self->pmc_allocator, Obj2LLH(pmc));
}
@@ -651,12 +651,12 @@
self.objects = ();
*/
self->dead_objects = self->objects;
- self->objects = Parrot_gc_allocate_linked_list(interp);
- self->black_objects = Parrot_gc_allocate_linked_list(interp);
- self->grey_objects = Parrot_gc_allocate_linked_list(interp);
+ self->objects = Parrot_list_new(interp);
+ self->black_objects = Parrot_list_new(interp);
+ self->grey_objects = Parrot_list_new(interp);
/* Put inside ASSERT wo it will not affect non-debug build */
- PARROT_ASSERT(Parrot_gc_list_check(interp, self->dead_objects));
+ PARROT_ASSERT(Parrot_list_check(interp, self->dead_objects));
//fprintf(stderr, "Before %zd\n", self->dead_objects->count);
@@ -672,14 +672,14 @@
gc_tms_mark_pmc_header(interp, PMCNULL);
//fprintf(stderr, "Roots %zd\n", self->grey_objects->count);
- PARROT_ASSERT(Parrot_gc_list_check(interp, self->grey_objects));
+ PARROT_ASSERT(Parrot_list_check(interp, self->grey_objects));
/*
# mark_alive will push into self.grey_objects
self.mark_real($_) for self.grey_objects;
*/
counter = 0;
- while ((tmp = Parrot_gc_list_pop(interp, self->grey_objects))) {
+ while ((tmp = Parrot_list_pop(interp, self->grey_objects))) {
PARROT_ASSERT(tmp->owner == self->grey_objects);
PARROT_ASSERT(PObj_grey_TEST(LLH2Obj_typed(tmp, PMC)));
@@ -714,8 +714,8 @@
//fprintf(stderr, "Dead %d\n", self->dead_objects->count);
/* Clean up */
- Parrot_gc_destroy_linked_list(interp, self->grey_objects);
- Parrot_gc_destroy_linked_list(interp, self->dead_objects);
+ Parrot_list_destroy(interp, self->grey_objects);
+ Parrot_list_destroy(interp, self->dead_objects);
/* Paint live objects white */
tmp = self->black_objects->first;
@@ -741,7 +741,7 @@
self->objects = list;
//fprintf(stderr, "Appending %zd\n", self->black_objects->count);
- while ((tmp = Parrot_gc_list_pop(interp, self->black_objects))) {
+ while ((tmp = Parrot_list_pop(interp, self->black_objects))) {
PARROT_ASSERT(tmp->owner == self->black_objects);
LIST_APPEND(self->objects, tmp);
}
@@ -843,7 +843,7 @@
return 0;
/* Pool.is_owned isn't precise enough (yet) */
- if (Parrot_gc_list_is_owned(interp, self->dead_objects, item))
+ if (Parrot_list_contains(interp, self->dead_objects, item))
return 1;
/* We don't care about non-dead objects here. They will be marked anyway */
Modified: branches/gc_massacre/src/list.c
==============================================================================
--- branches/gc_massacre/src/list.c Tue Jun 8 07:15:52 2010 (r47453)
+++ branches/gc_massacre/src/list.c Tue Jun 8 07:35:31 2010 (r47454)
@@ -29,7 +29,7 @@
=over 4
-=item C<struct Linked_List* Parrot_gc_allocate_linked_list(PARROT_INTERP)>
+=item C<struct Linked_List* Parrot_list_new(PARROT_INTERP)>
Allocate a doubly link list
@@ -40,9 +40,9 @@
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
struct Linked_List*
-Parrot_gc_allocate_linked_list(SHIM_INTERP)
+Parrot_list_new(SHIM_INTERP)
{
- ASSERT_ARGS(Parrot_gc_allocate_linked_list)
+ ASSERT_ARGS(Parrot_list_new)
Linked_List *res = (Linked_List*)mem_sys_allocate_zeroed(sizeof (Linked_List));
return res;
@@ -50,7 +50,7 @@
/*
-=item C<void Parrot_gc_destroy_linked_list(PARROT_INTERP, Linked_List* list)>
+=item C<void Parrot_list_destroy(PARROT_INTERP, Linked_List* list)>
Destroy the specified list (free up memory associated with the list)
@@ -60,16 +60,16 @@
PARROT_EXPORT
void
-Parrot_gc_destroy_linked_list(SHIM_INTERP, ARGMOD(Linked_List* list))
+Parrot_list_destroy(SHIM_INTERP, ARGMOD(Linked_List* list))
{
- ASSERT_ARGS(Parrot_gc_destroy_linked_list)
+ ASSERT_ARGS(Parrot_list_destroy)
mem_sys_free(list);
}
/*
-=item C<void Parrot_gc_list_append(PARROT_INTERP, Linked_List *list,
+=item C<void Parrot_list_append(PARROT_INTERP, Linked_List *list,
List_Item_Header *item)>
Append an item to the list
@@ -80,9 +80,9 @@
PARROT_EXPORT
void
-Parrot_gc_list_append(SHIM_INTERP, ARGMOD(Linked_List *list), ARGMOD(List_Item_Header *item))
+Parrot_list_append(SHIM_INTERP, ARGMOD(Linked_List *list), ARGMOD(List_Item_Header *item))
{
- ASSERT_ARGS(Parrot_gc_list_append)
+ ASSERT_ARGS(Parrot_list_append)
item->prev = item->next = NULL;
@@ -104,7 +104,7 @@
/*
-=item C<List_Item_Header* Parrot_gc_list_remove(PARROT_INTERP, Linked_List
+=item C<List_Item_Header* Parrot_list_remove(PARROT_INTERP, Linked_List
*list, List_Item_Header *item)>
Remove an item from the list, returning the (pointer to) item
@@ -115,9 +115,9 @@
PARROT_EXPORT
List_Item_Header*
-Parrot_gc_list_remove(SHIM_INTERP, ARGMOD(Linked_List *list), ARGMOD(List_Item_Header *item))
+Parrot_list_remove(SHIM_INTERP, ARGMOD(Linked_List *list), ARGMOD(List_Item_Header *item))
{
- ASSERT_ARGS(Parrot_gc_list_remove)
+ ASSERT_ARGS(Parrot_list_remove)
List_Item_Header *next = item->next;
List_Item_Header *prev = item->prev;
@@ -142,7 +142,7 @@
/*
-=item C<List_Item_Header* Parrot_gc_list_pop(PARROT_INTERP, Linked_List *list)>
+=item C<List_Item_Header* Parrot_list_pop(PARROT_INTERP, Linked_List *list)>
Pop an item off the list - i.e. get the first item in the list and remove it.
@@ -152,9 +152,9 @@
PARROT_EXPORT
List_Item_Header*
-Parrot_gc_list_pop(PARROT_INTERP, ARGIN(Linked_List *list))
+Parrot_list_pop(PARROT_INTERP, ARGIN(Linked_List *list))
{
- ASSERT_ARGS(Parrot_gc_list_pop)
+ ASSERT_ARGS(Parrot_list_pop)
List_Item_Header *ret = list->first;
if (ret)
@@ -164,7 +164,7 @@
/*
-=item C<int Parrot_gc_list_check(PARROT_INTERP, Linked_List *list)>
+=item C<int Parrot_list_check(PARROT_INTERP, Linked_List *list)>
Check the validity of the list
@@ -173,9 +173,9 @@
*/
int
-Parrot_gc_list_check(SHIM_INTERP, ARGIN(Linked_List *list))
+Parrot_list_check(SHIM_INTERP, ARGIN(Linked_List *list))
{
- ASSERT_ARGS(Parrot_gc_list_check)
+ ASSERT_ARGS(Parrot_list_check)
List_Item_Header *tmp = list->first;
size_t counter = 0;
@@ -193,19 +193,19 @@
/*
-=item C<int Parrot_gc_list_is_owned(PARROT_INTERP, Linked_List *list,
+=item C<int Parrot_list_contains(PARROT_INTERP, Linked_List *list,
List_Item_Header *item)>
-Returns True if the is owned by the list
+Returns True if the is in the list
=cut
*/
int
-Parrot_gc_list_is_owned(SHIM_INTERP, ARGIN(Linked_List *list), ARGIN(List_Item_Header *item))
+Parrot_list_contains(SHIM_INTERP, ARGIN(Linked_List *list), ARGIN(List_Item_Header *item))
{
- ASSERT_ARGS(Parrot_gc_list_is_owned)
+ ASSERT_ARGS(Parrot_list_contains)
List_Item_Header *tmp = list->first;
More information about the parrot-commits
mailing list