mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
ruby.h: remove RB_GC_GUARD_PTR
* include/ruby/ruby.h (RB_GC_GUARD_PTR): remove intermediate macro, and expand for each RB_GC_GUARD. [Fix GH-1293] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e1ee61bfbd
commit
37153c03f8
2 changed files with 9 additions and 12 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Thu Mar 17 22:21:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* include/ruby/ruby.h (RB_GC_GUARD_PTR): remove intermediate
|
||||||
|
macro, and expand for each RB_GC_GUARD. [Fix GH-1293]
|
||||||
|
|
||||||
Thu Mar 17 22:08:33 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Thu Mar 17 22:08:33 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* compile.c (iseq_specialized_instruction): move specialization
|
* compile.c (iseq_specialized_instruction): move specialization
|
||||||
|
|
|
@ -551,27 +551,19 @@ static inline int rb_type(VALUE obj);
|
||||||
((type) == RUBY_T_FLOAT) ? RB_FLOAT_TYPE_P(obj) : \
|
((type) == RUBY_T_FLOAT) ? RB_FLOAT_TYPE_P(obj) : \
|
||||||
(!RB_SPECIAL_CONST_P(obj) && RB_BUILTIN_TYPE(obj) == (type)))
|
(!RB_SPECIAL_CONST_P(obj) && RB_BUILTIN_TYPE(obj) == (type)))
|
||||||
|
|
||||||
/* RB_GC_GUARD_PTR() is an intermediate macro, and has no effect by
|
|
||||||
* itself. don't use it directly */
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define RB_GC_GUARD_PTR(ptr) \
|
#define RB_GC_GUARD(v) \
|
||||||
__extension__ ({volatile VALUE *rb_gc_guarded_ptr = (ptr); rb_gc_guarded_ptr;})
|
(*__extension__ ({volatile VALUE *rb_gc_guarded_ptr = &(v); rb_gc_guarded_ptr;}))
|
||||||
#else
|
#elif defined _MSC_VER
|
||||||
#ifdef _MSC_VER
|
|
||||||
#pragma optimize("", off)
|
#pragma optimize("", off)
|
||||||
static inline volatile VALUE *rb_gc_guarded_ptr(volatile VALUE *ptr) {return ptr;}
|
static inline volatile VALUE *rb_gc_guarded_ptr(volatile VALUE *ptr) {return ptr;}
|
||||||
#pragma optimize("", on)
|
#pragma optimize("", on)
|
||||||
|
#define RB_GC_GUARD(v) (*rb_gc_guarded_ptr(&(v)))
|
||||||
#else
|
#else
|
||||||
volatile VALUE *rb_gc_guarded_ptr_val(volatile VALUE *ptr, VALUE val);
|
volatile VALUE *rb_gc_guarded_ptr_val(volatile VALUE *ptr, VALUE val);
|
||||||
#define HAVE_RB_GC_GUARDED_PTR_VAL 1
|
#define HAVE_RB_GC_GUARDED_PTR_VAL 1
|
||||||
#define RB_GC_GUARD(v) (*rb_gc_guarded_ptr_val(&(v),(v)))
|
#define RB_GC_GUARD(v) (*rb_gc_guarded_ptr_val(&(v),(v)))
|
||||||
#endif
|
#endif
|
||||||
#define RB_GC_GUARD_PTR(ptr) rb_gc_guarded_ptr(ptr)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef RB_GC_GUARD
|
|
||||||
#define RB_GC_GUARD(v) (*RB_GC_GUARD_PTR(&(v)))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define RB_UNUSED_VAR(x) x __attribute__ ((unused))
|
#define RB_UNUSED_VAR(x) x __attribute__ ((unused))
|
||||||
|
|
Loading…
Add table
Reference in a new issue