1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

gc.c: rb_gc_guarded_ptr

* gc.c (rb_gc_guarded_ptr): unoptimize on other compilers than gcc and
  msvc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-05-17 08:35:26 +00:00
parent 4621799d3d
commit baa65ad108
3 changed files with 16 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Fri May 17 17:34:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* gc.c (rb_gc_guarded_ptr): unoptimize on other compilers than gcc and
msvc.
Fri May 17 11:06:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval_intern.h (TH_PUSH_TAG): ensure jmpbuf to be accessible before

8
gc.c
View file

@ -67,6 +67,14 @@
#define rb_setjmp(env) RUBY_SETJMP(env)
#define rb_jmp_buf rb_jmpbuf_t
#if defined(HAVE_RB_GC_GUARDED_PTR) && HAVE_RB_GC_GUARDED_PTR
volatile VALUE *
rb_gc_guarded_ptr(volatile VALUE *ptr)
{
return ptr;
}
#endif
#ifndef GC_MALLOC_LIMIT
#define GC_MALLOC_LIMIT 8000000
#endif

View file

@ -506,10 +506,11 @@ static inline int rb_type(VALUE obj);
#else
#ifdef _MSC_VER
#pragma optimize("", off)
#endif
static inline volatile VALUE *rb_gc_guarded_ptr(volatile VALUE *ptr) {return ptr;}
#ifdef _MSC_VER
#pragma optimize("", on)
#else
volatile VALUE *rb_gc_guarded_ptr(volatile VALUE *ptr);
#define HAVE_RB_GC_GUARDED_PTR 1
#endif
#define RB_GC_GUARD_PTR(ptr) rb_gc_guarded_ptr(ptr)
#endif