aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/ruby/backward.h3
-rw-r--r--include/ruby/intern.h1
-rw-r--r--variable.c60
3 files changed, 3 insertions, 61 deletions
diff --git a/include/ruby/backward.h b/include/ruby/backward.h
index ebe86b427d..8e7716bd12 100644
--- a/include/ruby/backward.h
+++ b/include/ruby/backward.h
@@ -35,6 +35,9 @@ DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_compile_error_append);
/* struct.c */
DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_struct_ptr);
+/* variable.c */
+DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_generic_ivar_table);
+
/* from version.c */
#ifndef RUBY_SHOW_COPYRIGHT_TO_DIE
# define RUBY_SHOW_COPYRIGHT_TO_DIE 1
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index ac2e539a65..22e76b6474 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -909,7 +909,6 @@ VALUE rb_f_trace_var(int, const VALUE*);
VALUE rb_f_untrace_var(int, const VALUE*);
VALUE rb_f_global_variables(void);
void rb_alias_variable(ID, ID);
-DEPRECATED(struct st_table* rb_generic_ivar_table(VALUE));
void rb_copy_generic_ivar(VALUE,VALUE);
void rb_free_generic_ivar(VALUE);
VALUE rb_ivar_get(VALUE, ID);
diff --git a/variable.c b/variable.c
index b416720127..d69471ef4f 100644
--- a/variable.c
+++ b/variable.c
@@ -942,27 +942,6 @@ rb_alias_variable(ID name1, ID name2)
entry1->var = entry2->var;
}
-#if 0
-struct gen_ivar_compat_tbl {
- struct gen_ivtbl *ivtbl;
- st_table *tbl;
-};
-
-static int
-gen_ivar_compat_tbl_i(st_data_t id, st_data_t index, st_data_t arg)
-{
- struct gen_ivar_compat_tbl *a = (struct gen_ivar_compat_tbl *)arg;
-
- if (index < a->ivtbl->numiv) {
- VALUE val = a->ivtbl->ivptr[index];
- if (val != Qundef) {
- st_add_direct(a->tbl, id, (st_data_t)val);
- }
- }
- return ST_CONTINUE;
-}
-#endif
-
static int
gen_ivtbl_get(VALUE obj, struct gen_ivtbl **ivtbl)
{
@@ -975,45 +954,6 @@ gen_ivtbl_get(VALUE obj, struct gen_ivtbl **ivtbl)
return 0;
}
-/* for backwards compatibility only */
-#ifdef __GNUC__
-NORETURN(st_table *rb_generic_ivar_table(VALUE obj));
-#endif
-st_table*
-rb_generic_ivar_table(VALUE obj)
-{
-#if 0
- st_table *iv_index_tbl = RCLASS_IV_INDEX_TBL(rb_obj_class(obj));
- struct gen_ivar_compat_tbl a;
- st_data_t d;
-
- if (!iv_index_tbl) return 0;
- if (!FL_TEST(obj, FL_EXIVAR)) return 0;
- if (!gen_ivtbl_get(obj, &a.ivtbl)) return 0;
-
- a.tbl = 0;
- if (!generic_iv_tbl_compat) {
- generic_iv_tbl_compat = st_init_numtable();
- }
- else {
- if (st_lookup(generic_iv_tbl_compat, (st_data_t)obj, &d)) {
- a.tbl = (st_table *)d;
- st_clear(a.tbl);
- }
- }
- if (!a.tbl) {
- a.tbl = st_init_numtable();
- d = (st_data_t)a.tbl;
- st_add_direct(generic_iv_tbl_compat, (st_data_t)obj, d);
- }
- st_foreach_safe(iv_index_tbl, gen_ivar_compat_tbl_i, (st_data_t)&a);
-
- return a.tbl;
-#else
- DEPRECATED_INTERNAL_FEATURE("rb_generic_ivar_table()");
-#endif
-}
-
static VALUE
generic_ivar_delete(VALUE obj, ID id, VALUE undef)
{