mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* vm_core.h: define VM_ASSERT() for assertion
enabled only when (VM_CHECK_MODE > 0). * vm_insnhelper.c: move definition VM_CHECK_MODE from vm_insnhelper.c to vm_core.h. * vm.c: remove <assert.h> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
62a81ad98c
commit
85647d9f2b
4 changed files with 26 additions and 10 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
Thu Jun 11 08:16:48 2015 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* vm_core.h: define VM_ASSERT() for assertion
|
||||||
|
enabled only when (VM_CHECK_MODE > 0).
|
||||||
|
|
||||||
|
* vm_insnhelper.c: move definition VM_CHECK_MODE
|
||||||
|
from vm_insnhelper.c to vm_core.h.
|
||||||
|
|
||||||
|
* vm.c: remove <assert.h>
|
||||||
|
|
||||||
Thu Jun 11 06:46:07 2015 Koichi Sasada <ko1@atdot.net>
|
Thu Jun 11 06:46:07 2015 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* vm_insnhelper.c (check_frame): check type of cref_or_me first.
|
* vm_insnhelper.c (check_frame): check type of cref_or_me first.
|
||||||
|
|
2
vm.c
2
vm.c
|
@ -146,8 +146,6 @@ static rb_serial_t ruby_vm_class_serial = 1;
|
||||||
#include "vm_method.c"
|
#include "vm_method.c"
|
||||||
#include "vm_eval.c"
|
#include "vm_eval.c"
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
#define PROCDEBUG 0
|
#define PROCDEBUG 0
|
||||||
|
|
||||||
rb_serial_t
|
rb_serial_t
|
||||||
|
|
16
vm_core.h
16
vm_core.h
|
@ -12,6 +12,22 @@
|
||||||
#ifndef RUBY_VM_CORE_H
|
#ifndef RUBY_VM_CORE_H
|
||||||
#define RUBY_VM_CORE_H
|
#define RUBY_VM_CORE_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Enable check mode.
|
||||||
|
* 1: enable local assertions.
|
||||||
|
*/
|
||||||
|
#ifndef VM_CHECK_MODE
|
||||||
|
#define VM_CHECK_MODE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if VM_CHECK_MODE > 0
|
||||||
|
#define VM_ASSERT(expr) do { \
|
||||||
|
if(!(expr)) rb_bug("%s:%d assertion violation - %s", __FILE__, __LINE__, #expr); \
|
||||||
|
} while (0)
|
||||||
|
#else
|
||||||
|
#define VM_ASSERT(expr)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define RUBY_VM_THREAD_MODEL 2
|
#define RUBY_VM_THREAD_MODEL 2
|
||||||
|
|
||||||
#include "ruby/ruby.h"
|
#include "ruby/ruby.h"
|
||||||
|
|
|
@ -16,14 +16,6 @@
|
||||||
#include "probes.h"
|
#include "probes.h"
|
||||||
#include "probes_helper.h"
|
#include "probes_helper.h"
|
||||||
|
|
||||||
/*
|
|
||||||
* Enable check mode.
|
|
||||||
* 1: enable local assertions.
|
|
||||||
*/
|
|
||||||
#ifndef VM_CHECK_MODE
|
|
||||||
#define VM_CHECK_MODE 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* control stack frame */
|
/* control stack frame */
|
||||||
|
|
||||||
#ifndef INLINE
|
#ifndef INLINE
|
||||||
|
|
Loading…
Add table
Reference in a new issue