зеркало из https://github.com/github/ruby.git
gc.h: evaluate the macro argument only once
* gc.h (RUBY_MARK_UNLESS_NULL): evaluate the argument only once to get rid of inadvertent side effects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
994460c4db
Коммит
bb8abf62d3
|
@ -1,3 +1,8 @@
|
|||
Wed Jul 15 08:59:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* gc.h (RUBY_MARK_UNLESS_NULL): evaluate the argument only once
|
||||
to get rid of inadvertent side effects.
|
||||
|
||||
Wed Jul 15 02:53:11 2015 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* vm_core.h, vm.c: remove rb_proc_t::envval because we can know it via
|
||||
|
|
5
gc.h
5
gc.h
|
@ -57,7 +57,10 @@ rb_gc_debug_body(const char *mode, const char *msg, int st, void *ptr)
|
|||
#define RUBY_GC_INFO if(0)printf
|
||||
#endif
|
||||
|
||||
#define RUBY_MARK_UNLESS_NULL(ptr) if(RTEST(ptr)){rb_gc_mark(ptr);}
|
||||
#define RUBY_MARK_UNLESS_NULL(ptr) do { \
|
||||
VALUE markobj = (ptr); \
|
||||
if (RTEST(markobj)) {rb_gc_mark(markobj);} \
|
||||
} while (0)
|
||||
#define RUBY_FREE_UNLESS_NULL(ptr) if(ptr){ruby_xfree(ptr);(ptr)=NULL;}
|
||||
|
||||
#if STACK_GROW_DIRECTION > 0
|
||||
|
|
Загрузка…
Ссылка в новой задаче