зеркало из https://github.com/github/ruby.git
* gc.c: add rb_during_gc(). based on a patch from arton <artonx AT
yahoo.co.jp> at [ruby-dev:35313]. * include/ruby/intern.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
5c72ffe769
Коммит
8519afcb41
|
@ -1,3 +1,10 @@
|
|||
Thu Jul 3 00:09:31 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
|
||||
|
||||
* gc.c: add rb_during_gc(). based on a patch from arton <artonx AT
|
||||
yahoo.co.jp> at [ruby-dev:35313].
|
||||
|
||||
* include/ruby/intern.h: ditto.
|
||||
|
||||
Wed Jul 2 09:49:10 2008 Narihiro Nakamura <authorNari@gmail.com>
|
||||
|
||||
* gc.c (gc_lazy_sweep) : use lazy sweep algorithm for response performance gain.
|
||||
|
|
17
gc.c
17
gc.c
|
@ -723,6 +723,23 @@ rb_fill_value_cache(rb_thread_t *th)
|
|||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
rb_during_gc(void)
|
||||
{
|
||||
#if USE_VALUE_CACHE
|
||||
rb_thread_t *th = GET_THREAD();
|
||||
VALUE v = *th->value_cache_ptr;
|
||||
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
|
||||
rb_objspace_t *objspace = th->vm->objspace;
|
||||
#else
|
||||
rb_objspace_t *objspace = &rb_objspace;
|
||||
#endif
|
||||
#else
|
||||
rb_objspace_t *objspace = &rb_objspace;
|
||||
#endif
|
||||
return during_gc;
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_newobj(void)
|
||||
{
|
||||
|
|
|
@ -329,6 +329,7 @@ void ruby_set_stack_size(size_t);
|
|||
NORETURN(void rb_memerror(void));
|
||||
int ruby_stack_check(void);
|
||||
int ruby_stack_length(VALUE**);
|
||||
int rb_during_gc(void);
|
||||
void rb_gc_mark_locations(VALUE*, VALUE*);
|
||||
void rb_mark_tbl(struct st_table*);
|
||||
void rb_mark_set(struct st_table*);
|
||||
|
|
Загрузка…
Ссылка в новой задаче