summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-14 07:09:32 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-14 07:09:32 +0000
commitaa815c58243aad69aaa44f30883002da1ee816d8 (patch)
treea5bab96672e49d533ef155ae124fd8022c045aab
parent1bf61d770a0c2549536b8c519551d74b0db44c75 (diff)
merge revision(s) 33500,33501:
* gc.c (rb_gc_set_params): set parameters always. [ruby-dev:44648] [Bug #5467] * gc.c (initial_params): pack in a struct. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--gc.c30
-rw-r--r--version.h2
3 files changed, 27 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index c403cf4531..e7845d3473 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Tue Feb 14 15:58:31 2012 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * gc.c (rb_gc_set_params): set parameters always.
+ [ruby-dev:44648] [Bug #5467]
+
+ * gc.c (initial_params): pack in a struct.
+
Tue Feb 14 15:44:42 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* test/irb/test_completion.rb: skip if cannot load irb/completion
diff --git a/gc.c b/gc.c
index 5fd43cd82f..aacc792bd0 100644
--- a/gc.c
+++ b/gc.c
@@ -80,11 +80,21 @@ void *alloca ();
#define HEAP_MIN_SLOTS 10000
#define FREE_MIN 4096
-static unsigned int initial_malloc_limit = GC_MALLOC_LIMIT;
+typedef struct {
+ unsigned int initial_malloc_limit;
+ unsigned int initial_heap_min_slots;
+ unsigned int initial_free_min;
+ int gc_stress;
+} ruby_gc_params_t;
+
+ruby_gc_params_t initial_params = {
+ GC_MALLOC_LIMIT,
+ HEAP_MIN_SLOTS,
+ FREE_MIN,
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
-static unsigned int initial_heap_min_slots = HEAP_MIN_SLOTS;
+ FALSE,
#endif
-static unsigned int initial_free_min = FREE_MIN;
+};
#define nomem_error GET_VM()->special_exceptions[ruby_error_nomemory]
@@ -364,7 +374,7 @@ typedef struct rb_objspace {
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
#define rb_objspace (*GET_VM()->objspace)
-static int ruby_initial_gc_stress = 0;
+#define ruby_initial_gc_stress initial_params.gc_stress
int *ruby_initial_gc_stress_ptr = &ruby_initial_gc_stress;
#else
static rb_objspace_t rb_objspace = {{GC_MALLOC_LIMIT}, {HEAP_MIN_SLOTS}};
@@ -389,6 +399,9 @@ int *ruby_initial_gc_stress_ptr = &rb_objspace.gc_stress;
#define mark_stack_overflow objspace->markstack.overflow
#define global_List objspace->global_list
#define ruby_gc_stress objspace->gc_stress
+#define initial_malloc_limit initial_params.initial_malloc_limit
+#define initial_heap_min_slots initial_params.initial_heap_min_slots
+#define initial_free_min initial_params.initial_free_min
static void rb_objspace_call_finalizer(rb_objspace_t *objspace);
@@ -403,6 +416,7 @@ rb_objspace_alloc(void)
return objspace;
}
+#endif
static void initial_expand_heap(rb_objspace_t *objspace);
@@ -447,6 +461,7 @@ rb_gc_set_params(void)
}
}
+#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
static void gc_sweep(rb_objspace_t *);
static void slot_sweep(rb_objspace_t *, struct heaps_slot *);
static void gc_clear_mark_on_sweep_slots(rb_objspace_t *);
@@ -479,11 +494,6 @@ rb_objspace_free(rb_objspace_t *objspace)
}
free(objspace);
}
-#else
-void
-rb_gc_set_params(void)
-{
-}
#endif
/* tiny heap size */
@@ -1105,7 +1115,6 @@ init_heap(rb_objspace_t *objspace)
finalizer_table = st_init_numtable();
}
-#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
static void
initial_expand_heap(rb_objspace_t *objspace)
{
@@ -1115,7 +1124,6 @@ initial_expand_heap(rb_objspace_t *objspace)
add_heap_slots(objspace, min_size - heaps_used);
}
}
-#endif
static void
set_heaps_increment(rb_objspace_t *objspace)
diff --git a/version.h b/version.h
index 0573811a4f..00f4c0a0ac 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 106
+#define RUBY_PATCHLEVEL 107
#define RUBY_RELEASE_DATE "2012-02-14"
#define RUBY_RELEASE_YEAR 2012