diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-12-25 04:35:44 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-12-25 04:35:44 +0000 |
commit | e3ae94452e6b84bd7f3c40166713f38a0585d834 (patch) | |
tree | 43142e9f6788e01e34588c46353a6a36d7e8bbd3 /eval.c | |
parent | 17a5fa1b4344199cef86c2cea4f1ba35f021593d (diff) |
1.2 stable
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -1258,15 +1258,15 @@ mod_alias_method(mod, newname, oldname) return mod; } -#if defined(C_ALLOCA) && defined(THREAD) -# define TMP_PROTECT NODE *__protect_tmp=0 -# define TMP_ALLOC(type,n) \ - (__protect_tmp = node_newnode(NODE_ALLOCA, \ - str_new(0,sizeof(type)*(n)),0,__protect_tmp), \ - (void*)RSTRING(__protect_tmp->nd_head)->ptr) +#if defined(C_ALLOCA) +# define TMP_PROTECT NODE * volatile __protect_tmp=0 +# define TMP_ALLOC(n) \ + (__protect_tmp = node_newnode(NODE_ALLOCA, \ + ALLOCA_N(VALUE,n),__protect_tmp,n),\ + (void*)__protect_tmp->nd_head) #else # define TMP_PROTECT typedef int foobazzz -# define TMP_ALLOC(type,n) ALLOCA_N(type,n) +# define TMP_ALLOC(n) ALLOCA_N(VALUE,n) #endif #define SETUP_ARGS(anode) {\ @@ -1282,7 +1282,7 @@ mod_alias_method(mod, newname, oldname) int line = sourceline;\ int i;\ n = anode;\ - argv = TMP_ALLOC(VALUE,argc);\ + argv = TMP_ALLOC(argc);\ for (i=0;i<argc;i++) {\ argv[i] = rb_eval(self,n->nd_head);\ n=n->nd_next;\ @@ -2643,7 +2643,7 @@ module_setup(module, node) if (node->nd_rval) the_frame->cbase = node->nd_rval; if (node->nd_tbl) { - VALUE *vars = TMP_ALLOC(VALUE, node->nd_tbl[0]+1); + VALUE *vars = TMP_ALLOC(node->nd_tbl[0]+1); *vars++ = (VALUE)node; the_scope->local_vars = vars; memclear(the_scope->local_vars, node->nd_tbl[0]); @@ -3493,7 +3493,7 @@ rb_call0(klass, recv, id, argc, argv, body, nosuper) if (body->nd_rval) the_frame->cbase = body->nd_rval; if (body->nd_tbl) { - local_vars = TMP_ALLOC(VALUE, body->nd_tbl[0]+1); + local_vars = TMP_ALLOC(body->nd_tbl[0]+1); *local_vars++ = (VALUE)body; memclear(local_vars, body->nd_tbl[0]); the_scope->local_tbl = body->nd_tbl; @@ -4187,7 +4187,7 @@ f_load(obj, fname) if (top_scope->local_tbl) { int len = top_scope->local_tbl[0]+1; ID *tbl = ALLOC_N(ID, len); - VALUE *vars = TMP_ALLOC(VALUE, len); + VALUE *vars = TMP_ALLOC(len); *vars++ = 0; MEMCPY(tbl, top_scope->local_tbl, ID, len); MEMCPY(vars, top_scope->local_vars, ID, len-1); |