vm_core.h: move jmpbuf between tag and prev
* vm_core.h (rb_vm_tag): move jmpbuf between tag and prev so ensure to be accessible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8a28e97ae9
commit
3e8bba2fc1
@ -1,3 +1,8 @@
|
|||||||
|
Sat May 18 15:49:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* vm_core.h (rb_vm_tag): move jmpbuf between tag and prev so ensure to
|
||||||
|
be accessible.
|
||||||
|
|
||||||
Sat May 18 11:05:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sat May 18 11:05:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* enumerator.c (inspect_enumerator): use VALUE instead of mere char*
|
* enumerator.c (inspect_enumerator): use VALUE instead of mere char*
|
||||||
|
@ -91,20 +91,9 @@ extern int select_large_fdset(int, fd_set *, fd_set *, fd_set *, struct timeval
|
|||||||
rb_fiber_start(); \
|
rb_fiber_start(); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
/*
|
|
||||||
ensure tag to be accessible, `buf' is at the beginning.
|
|
||||||
the end is `prev' which is written in TH_PUSH_TAG().
|
|
||||||
*/
|
|
||||||
#if defined(__GNUC__) && __GNUC__ >= 4
|
|
||||||
/* suppress -Wstrict-aliasing, and should be inlined */
|
|
||||||
# define ENSURE_TAG_WRITABLE(tag) MEMZERO((tag).buf, int, 1)
|
|
||||||
#else
|
|
||||||
# define ENSURE_TAG_WRITABLE(tag) (*(volatile int *)(tag).buf = 0)
|
|
||||||
#endif
|
|
||||||
#define TH_PUSH_TAG(th) do { \
|
#define TH_PUSH_TAG(th) do { \
|
||||||
rb_thread_t * const _th = (th); \
|
rb_thread_t * const _th = (th); \
|
||||||
struct rb_vm_tag _tag; \
|
struct rb_vm_tag _tag; \
|
||||||
ENSURE_TAG_WRITABLE(_tag); \
|
|
||||||
_tag.tag = 0; \
|
_tag.tag = 0; \
|
||||||
_tag.prev = _th->tag; \
|
_tag.prev = _th->tag; \
|
||||||
_th->tag = &_tag;
|
_th->tag = &_tag;
|
||||||
|
@ -464,10 +464,14 @@ enum rb_thread_status {
|
|||||||
|
|
||||||
typedef RUBY_JMP_BUF rb_jmpbuf_t;
|
typedef RUBY_JMP_BUF rb_jmpbuf_t;
|
||||||
|
|
||||||
|
/*
|
||||||
|
the members which are written in TH_PUSH_TAG() should be placed at
|
||||||
|
the beginning and the end, so that entire region is accessible.
|
||||||
|
*/
|
||||||
struct rb_vm_tag {
|
struct rb_vm_tag {
|
||||||
rb_jmpbuf_t buf;
|
|
||||||
VALUE tag;
|
VALUE tag;
|
||||||
VALUE retval;
|
VALUE retval;
|
||||||
|
rb_jmpbuf_t buf;
|
||||||
struct rb_vm_tag *prev;
|
struct rb_vm_tag *prev;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user