зеркало из https://github.com/github/ruby.git
* gc.c (ruby_initial_gc_stress): defined.
(ruby_initial_gc_stress_ptr): defined. * debug.c (set_debug_option): use ruby_initial_gc_stress_ptr for gc_stress option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
4641b80166
Коммит
436b02b332
|
@ -1,3 +1,11 @@
|
|||
Sat Jun 14 07:52:53 2008 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* gc.c (ruby_initial_gc_stress): defined.
|
||||
(ruby_initial_gc_stress_ptr): defined.
|
||||
|
||||
* debug.c (set_debug_option): use ruby_initial_gc_stress_ptr for
|
||||
gc_stress option.
|
||||
|
||||
Sat Jun 14 00:09:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* gc.c (ruby_gc_stress): moved to rb_objspace_t.
|
||||
|
|
8
debug.c
8
debug.c
|
@ -141,13 +141,13 @@ set_debug_option(const char *str, int len, void *arg)
|
|||
#define SET_WHEN(name, var) do { \
|
||||
if (len == sizeof(name) - 1 && \
|
||||
strncmp(str, name, len) == 0) { \
|
||||
extern int ruby_##var; \
|
||||
ruby_##var = 1; \
|
||||
extern int var; \
|
||||
var = 1; \
|
||||
return; \
|
||||
} \
|
||||
} while (0)
|
||||
SET_WHEN("gc_stress", gc_stress);
|
||||
SET_WHEN("core", enable_coredump);
|
||||
SET_WHEN("gc_stress", *ruby_initial_gc_stress_ptr);
|
||||
SET_WHEN("core", ruby_enable_coredump);
|
||||
fprintf(stderr, "unexpected debug option: %.*s\n", len, str);
|
||||
}
|
||||
|
||||
|
|
4
gc.c
4
gc.c
|
@ -184,8 +184,11 @@ 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;
|
||||
int *ruby_initial_gc_stress_ptr = &ruby_initial_gc_stress;
|
||||
#else
|
||||
static rb_objspace_t rb_objspace = {{GC_MALLOC_LIMIT}, {HEAP_MIN_SLOTS}};
|
||||
int *ruby_initial_gc_stress_ptr = &rb_objspace.gc_stress;
|
||||
#endif
|
||||
#define malloc_limit objspace->malloc_params.limit
|
||||
#define malloc_increase objspace->malloc_params.increase
|
||||
|
@ -216,6 +219,7 @@ rb_objspace_alloc(void)
|
|||
rb_objspace_t *objspace = malloc(sizeof(rb_objspace_t));
|
||||
memset(objspace, 0, sizeof(*objspace));
|
||||
malloc_limit = GC_MALLOC_LIMIT;
|
||||
ruby_gc_stress = ruby_initial_gc_stress;
|
||||
|
||||
return objspace;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче