diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-12 03:41:51 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-12 03:41:51 +0000 |
commit | 7b4a171158fffbb984378a094e7195072b0a5b05 (patch) | |
tree | 02e1ba5cea0f1ba987e187458ce3edaae3e01c3c /gc.c | |
parent | e72b71d56a1f369cb7eb3892c61715460bac8109 (diff) | |
download | ruby-7b4a171158fffbb984378a094e7195072b0a5b05.tar.gz |
* eval.c (ruby_exec_node, ruby_run_node), ruby.c (process_options):
use iseq instead of NODE.
* gc.c (source_filenames): removed.
* include/ruby/intern.h, parse.y (yycompile, parser_mark, parser_free,
ripper_initialize): rb_source_filename() is no longer used.
* compile.c, compile.h (ERROR_ARGS), parse.y (node_newnode, fixpos,
parser_warn, e_option_supplied, warn_unless_e_option, range_op,
cond0): nd_file is no longer used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 48 |
1 files changed, 0 insertions, 48 deletions
@@ -665,47 +665,6 @@ init_mark_stack(void) #define MARK_STACK_EMPTY (mark_stack_ptr == mark_stack) -static st_table *source_filenames; - -char * -rb_source_filename(const char *f) -{ - st_data_t name; - - if (!st_lookup(source_filenames, (st_data_t)f, &name)) { - long len = strlen(f) + 1; - char *ptr = ALLOC_N(char, len + 1); - - name = (st_data_t)ptr; - *ptr++ = 0; - MEMCPY(ptr, f, char, len); - st_add_direct(source_filenames, (st_data_t)ptr, name); - return ptr; - } - return (char *)name + 1; -} - -void -rb_mark_source_filename(char *f) -{ - if (f) { - f[-1] = 1; - } -} - -static int -sweep_source_filename(char *key, char *value) -{ - if (*value) { - *value = 0; - return ST_CONTINUE; - } - else { - free(value); - return ST_DELETE; - } -} - static void gc_mark(VALUE ptr, int lev); static void gc_mark_children(VALUE ptr, int lev); @@ -924,7 +883,6 @@ gc_mark_children(VALUE ptr, int lev) break; case T_NODE: - rb_mark_source_filename(obj->as.node.nd_file); switch (nd_type(obj)) { case NODE_IF: /* 1,2,3 */ case NODE_FOR: @@ -1221,10 +1179,6 @@ gc_sweep(void) if (free_min < FREE_MIN) free_min = FREE_MIN; - if (source_filenames) { - st_foreach(source_filenames, sweep_source_filename, 0); - } - freelist = 0; final_list = deferred_final_list; deferred_final_list = 0; @@ -2335,8 +2289,6 @@ Init_GC(void) rb_gc_unregister_address(&rb_mObSpace); finalizers = rb_ary_new(); - source_filenames = st_init_strtable(); - rb_global_variable(&nomem_error); nomem_error = rb_exc_new2(rb_eNoMemError, "failed to allocate memory"); |