From 7b4a171158fffbb984378a094e7195072b0a5b05 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 12 Apr 2008 03:41:51 +0000 Subject: * 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 --- gc.c | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) (limited to 'gc.c') diff --git a/gc.c b/gc.c index e090b0db49..eefa9d6f7d 100644 --- a/gc.c +++ b/gc.c @@ -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"); -- cgit v1.2.3