[svn:parrot] r47131 - in branches/gc_massacre: config/gen/makefiles src/gc

bacek at svn.parrot.org bacek at svn.parrot.org
Sun May 30 08:15:00 UTC 2010


Author: bacek
Date: Sun May 30 08:14:59 2010
New Revision: 47131
URL: https://trac.parrot.org/parrot/changeset/47131

Log:
Start cutting PMC_Attribute_Pool as Pool_Allocator.

Added:
   branches/gc_massacre/src/gc/pool_allocator.c
   branches/gc_massacre/src/gc/pool_allocator.h
Modified:
   branches/gc_massacre/config/gen/makefiles/root.in

Modified: branches/gc_massacre/config/gen/makefiles/root.in
==============================================================================
--- branches/gc_massacre/config/gen/makefiles/root.in	Sun May 30 08:09:03 2010	(r47130)
+++ branches/gc_massacre/config/gen/makefiles/root.in	Sun May 30 08:14:59 2010	(r47131)
@@ -451,6 +451,7 @@
     src/gc/gc_inf$(O) \
     src/gc/mark_sweep$(O) \
     src/gc/system$(O) \
+    src/gc/pool_allocator$(O) \
     src/global$(O) \
     src/global_setup$(O) \
     src/hash$(O) \
@@ -1272,7 +1273,7 @@
 
 src/gc/mark_sweep$(O) : $(PARROT_H_HEADERS) src/gc/gc_private.h src/gc/mark_sweep.c
 
-src/gc/gc_ms$(O) : $(PARROT_H_HEADERS) src/gc/gc_private.h src/gc/gc_ms.c
+src/gc/gc_ms$(O) : $(PARROT_H_HEADERS) src/gc/gc_private.h src/gc/pool_allocator.h src/gc/gc_ms.c
 
 src/gc/gc_inf$(O) : $(PARROT_H_HEADERS) src/gc/gc_private.h src/gc/gc_inf.c
 
@@ -1281,6 +1282,9 @@
 src/gc/alloc_resources$(O) : $(PARROT_H_HEADERS) \
 	src/gc/gc_private.h src/gc/alloc_resources.c
 
+src/gc/pool_allocator$(O) : $(PARROT_H_HEADERS) \
+	src/gc/pool_allocator.h src/gc/pool_allocator.c
+
 src/hll$(O) : $(PARROT_H_HEADERS) src/hll.str $(INC_DIR)/dynext.h src/hll.c
 
 src/platform$(O) : $(PARROT_H_HEADERS) src/platform.c

Added: branches/gc_massacre/src/gc/pool_allocator.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/gc_massacre/src/gc/pool_allocator.c	Sun May 30 08:14:59 2010	(r47131)
@@ -0,0 +1,39 @@
+/*
+Copyright (C) 2010, Parrot Foundation.
+$Id$
+
+=head1 NAME
+
+src/gc/pool_allocator.c - Implementation of PoolAllocator
+
+=head1 DESCRIPTION
+
+This code implements PoolAllocator.
+
+=cut
+
+*/
+
+/* HEADERIZER HFILE: src/gc/pool_allocator.h */
+
+/* HEADERIZER BEGIN: static */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+
+
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: static */
+
+/*
+
+=back
+
+=cut
+
+*/
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Added: branches/gc_massacre/src/gc/pool_allocator.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/gc_massacre/src/gc/pool_allocator.h	Sun May 30 08:14:59 2010	(r47131)
@@ -0,0 +1,56 @@
+/*
+Copyright (C) 2010, Parrot Foundation.
+$Id$
+
+=head1 NAME
+
+src/gc/pool_allocator.h - PoolAllocator for Parrot.
+
+=head1 DESCRIPTION
+
+
+
+*/
+
+#ifndef PARROT_GC_POOL_ALLOCATOR_H_GUARD
+#define PARROT_GC_POOL_ALLOCATOR_H_GUARD
+
+#include "parrot/settings.h"
+
+typedef struct Pool_Allocator_Free_List {
+    struct Pool_Allocator_Free_List * next;
+} Pool_Allocator_Free_List;
+
+typedef struct Pool_Allocator_Arena {
+    struct Pool_Allocator_Arena * next;
+    struct Pool_Allocator_Arena * prev;
+} Pool_Allocator_Arena;
+
+typedef struct Pool_Allocator_Pool {
+    size_t attr_size;
+    size_t total_objects;
+    size_t objects_per_alloc;
+    size_t num_free_objects;
+    Pool_Allocator_Free_List * free_list;
+    Pool_Allocator_Arena     * top_arena;
+#if GC_USE_LAZY_ALLOCATOR
+    Pool_Allocator_Free_List * newfree;
+    Pool_Allocator_Free_List * newlast;
+#endif
+} Pool_Allocator_Pool;
+
+/* HEADERIZER BEGIN: src/gc/pool_allocator.c */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: src/gc/pool_allocator.c */
+
+#endif /* PARROT_GC_POOL_ALLOCATOR_H_GUARD */
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
+


More information about the parrot-commits mailing list