* gc.c (initial_params): pack in a struct.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fd807aa2ea
commit
cb2a69d883
@ -1,4 +1,6 @@
|
|||||||
Fri Oct 21 22:01:35 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Oct 21 22:02:17 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* gc.c (initial_params): pack in a struct.
|
||||||
|
|
||||||
* gc.c (rb_gc_set_params): set parameters always.
|
* gc.c (rb_gc_set_params): set parameters always.
|
||||||
[ruby-dev:44648] [Bug #5467]
|
[ruby-dev:44648] [Bug #5467]
|
||||||
|
23
gc.c
23
gc.c
@ -80,11 +80,23 @@ void *alloca ();
|
|||||||
#define HEAP_MIN_SLOTS 10000
|
#define HEAP_MIN_SLOTS 10000
|
||||||
#define FREE_MIN 4096
|
#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;
|
||||||
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
|
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
|
||||||
static unsigned int initial_heap_min_slots = HEAP_MIN_SLOTS;
|
int gc_stress;
|
||||||
#endif
|
#endif
|
||||||
static unsigned int initial_free_min = FREE_MIN;
|
} 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
|
||||||
|
FALSE,
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
#define nomem_error GET_VM()->special_exceptions[ruby_error_nomemory]
|
#define nomem_error GET_VM()->special_exceptions[ruby_error_nomemory]
|
||||||
|
|
||||||
@ -370,7 +382,7 @@ typedef struct rb_objspace {
|
|||||||
|
|
||||||
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
|
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
|
||||||
#define rb_objspace (*GET_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;
|
int *ruby_initial_gc_stress_ptr = &ruby_initial_gc_stress;
|
||||||
#else
|
#else
|
||||||
static rb_objspace_t rb_objspace = {{GC_MALLOC_LIMIT}, {HEAP_MIN_SLOTS}};
|
static rb_objspace_t rb_objspace = {{GC_MALLOC_LIMIT}, {HEAP_MIN_SLOTS}};
|
||||||
@ -396,6 +408,9 @@ int *ruby_initial_gc_stress_ptr = &rb_objspace.gc_stress;
|
|||||||
#define mark_stack_overflow objspace->markstack.overflow
|
#define mark_stack_overflow objspace->markstack.overflow
|
||||||
#define global_List objspace->global_list
|
#define global_List objspace->global_list
|
||||||
#define ruby_gc_stress objspace->gc_stress
|
#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
|
||||||
|
|
||||||
#define is_lazy_sweeping(objspace) ((objspace)->heap.sweep_slots != 0)
|
#define is_lazy_sweeping(objspace) ((objspace)->heap.sweep_slots != 0)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user