summaryrefslogtreecommitdiff
path: root/yarvcore.h
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-24 18:40:13 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-24 18:40:13 +0000
commit144ff322c7adcc600139da1cfacf0e98010c1bce (patch)
treed167acd2633820df6a0840a68ae3592bbdb5f0e7 /yarvcore.h
parent7980e653e57ae5b539533dee1d0b1a00fc16ea5d (diff)
* insnhelper.ci (caller_setup_args): add need_block_check option.
* insns.def: ditto. * yarvcore.h: add GetCoreDataFromValue(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'yarvcore.h')
-rw-r--r--yarvcore.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/yarvcore.h b/yarvcore.h
index 054056c4fb7..3a23cd81ca0 100644
--- a/yarvcore.h
+++ b/yarvcore.h
@@ -214,7 +214,16 @@ struct iseq_compile_data {
const rb_compile_option_t *option;
};
-#define GetISeqPtr(obj, ptr) Data_Get_Struct(obj, rb_iseq_t, ptr)
+#if 1
+#define GetCoreDataFromValue(obj, type, ptr) do { \
+ ptr = (type*)DATA_PTR(obj); \
+} while (0)
+#else
+#define GetCoreDataFromValue(obj, type, ptr) Data_Get_Struct(obj, type, ptr)
+#endif
+
+#define GetISeqPtr(obj, ptr) \
+ GetCoreDataFromValue(obj, rb_iseq_t, ptr)
typedef struct rb_iseq_profile_struct {
VALUE count;
@@ -337,7 +346,7 @@ typedef struct rb_event_hook_struct {
#define GetVMPtr(obj, ptr) \
- Data_Get_Struct(obj, rb_vm_t, ptr)
+ GetCoreDataFromValue(obj, rb_vm_t, ptr)
typedef struct rb_vm_struct {
VALUE self;
@@ -395,7 +404,7 @@ typedef struct {
} rb_block_t;
#define GetThreadPtr(obj, ptr) \
- Data_Get_Struct(obj, rb_thread_t, ptr)
+ GetCoreDataFromValue(obj, rb_thread_t, ptr)
enum rb_thread_status {
THREAD_TO_KILL,
@@ -538,7 +547,7 @@ struct global_entry {
};
#define GetProcPtr(obj, ptr) \
- Data_Get_Struct(obj, rb_proc_t, ptr)
+ GetCoreDataFromValue(obj, rb_proc_t, ptr)
typedef struct {
rb_block_t block;
@@ -552,7 +561,7 @@ typedef struct {
} rb_proc_t;
#define GetEnvPtr(obj, ptr) \
- Data_Get_Struct(obj, rb_env_t, ptr)
+ GetCoreDataFromValue(obj, rb_env_t, ptr)
typedef struct {
VALUE *env;
@@ -563,7 +572,7 @@ typedef struct {
} rb_env_t;
#define GetBindingPtr(obj, ptr) \
- Data_Get_Struct(obj, rb_binding_t, ptr)
+ GetCoreDataFromValue(obj, rb_binding_t, ptr)
typedef struct {
VALUE env;