[svn:parrot] r47171 - branches/gc_massacre/src/gc
bacek at svn.parrot.org
bacek at svn.parrot.org
Sun May 30 22:22:08 UTC 2010
Author: bacek
Date: Sun May 30 22:22:07 2010
New Revision: 47171
URL: https://trac.parrot.org/parrot/changeset/47171
Log:
Rename PoolAllocator.attrib_size to .object_size
Modified:
branches/gc_massacre/src/gc/pool_allocator.c
branches/gc_massacre/src/gc/pool_allocator.h
Modified: branches/gc_massacre/src/gc/pool_allocator.c
==============================================================================
--- branches/gc_massacre/src/gc/pool_allocator.c Sun May 30 21:21:31 2010 (r47170)
+++ branches/gc_massacre/src/gc/pool_allocator.c Sun May 30 22:22:07 2010 (r47171)
@@ -80,7 +80,7 @@
const size_t num_objs = (num_objs_raw == 0)?(1):(num_objs_raw);
Pool_Allocator * const newpool = mem_internal_allocate_typed(Pool_Allocator);
- newpool->attr_size = attrib_size;
+ newpool->object_size = attrib_size;
newpool->total_objects = 0;
newpool->objects_per_alloc = num_objs;
newpool->num_free_objects = 0;
@@ -122,7 +122,7 @@
else if (pool->newfree) {
item = pool->newfree;
pool->newfree = (Pool_Allocator_Free_List *)
- ((char *)(pool->newfree) + pool->attr_size);
+ ((char *)(pool->newfree) + pool->object_size);
if (pool->newfree >= pool->newlast)
pool->newfree = NULL;
}
@@ -172,7 +172,7 @@
Pool_Allocator_Arena *arena = pool->top_arena;
while (arena) {
const ptrdiff_t ptr_diff =
- (ptrdiff_t)ptr - (ptrdiff_t)(arena + sizeof (Pool_Allocator_Arena));
+ (ptrdiff_t)ptr - (ptrdiff_t)(arena + 1);
if (0 <= ptr_diff
&& ptr_diff < GC_FIXED_SIZE_POOL_SIZE // It's wrong check.
@@ -193,7 +193,7 @@
Pool_Allocator_Free_List *next;
const size_t num_items = pool->objects_per_alloc;
- const size_t item_size = pool->attr_size;
+ const size_t item_size = pool->object_size;
const size_t item_space = item_size * num_items;
size_t total_size = sizeof (Pool_Allocator_Arena) + item_space;
Modified: branches/gc_massacre/src/gc/pool_allocator.h
==============================================================================
--- branches/gc_massacre/src/gc/pool_allocator.h Sun May 30 21:21:31 2010 (r47170)
+++ branches/gc_massacre/src/gc/pool_allocator.h Sun May 30 22:22:07 2010 (r47171)
@@ -37,7 +37,7 @@
} Pool_Allocator_Arena;
typedef struct Pool_Allocator {
- size_t attr_size;
+ size_t object_size;
size_t total_objects;
size_t objects_per_alloc;
size_t num_free_objects;
More information about the parrot-commits
mailing list