summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorMatt Valentine-House <matt@eightbitraptor.com>2023-02-14 19:40:05 +0000
committerPeter Zhu <peter@peterzhu.ca>2023-02-17 09:49:45 -0500
commit81dc3a1780319f4bc232af407edea60a35d251ed (patch)
treed133ed00c8f893635bc299329d5fe83e679f98cd /gc.c
parenta7beb4cfad58064fc0a45b9d147030e794c33b30 (diff)
Remove USE_RGENGC_LOGGING_WB_UNPROTECT
This macro is broken when set to anything other than 0. And has had a comment saying that it's broken for 3 years. This commit deletes it and the associated logging code. It's clearly not being used. Co-Authored-By: Peter Zhu <peter@peterzhu.ca>
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7312
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/gc.c b/gc.c
index e7bfc47205..3c2b82a2f9 100644
--- a/gc.c
+++ b/gc.c
@@ -9128,49 +9128,6 @@ rb_gc_writebarrier_remember(VALUE obj)
}
}
-static st_table *rgengc_unprotect_logging_table;
-
-static int
-rgengc_unprotect_logging_exit_func_i(st_data_t key, st_data_t val, st_data_t arg)
-{
- fprintf(stderr, "%s\t%"PRIuVALUE"\n", (char *)key, (VALUE)val);
- return ST_CONTINUE;
-}
-
-static void
-rgengc_unprotect_logging_exit_func(void)
-{
- st_foreach(rgengc_unprotect_logging_table, rgengc_unprotect_logging_exit_func_i, 0);
-}
-
-void
-rb_gc_unprotect_logging(void *objptr, const char *filename, int line)
-{
- VALUE obj = (VALUE)objptr;
-
- if (rgengc_unprotect_logging_table == 0) {
- rgengc_unprotect_logging_table = st_init_strtable();
- atexit(rgengc_unprotect_logging_exit_func);
- }
-
- if (RVALUE_WB_UNPROTECTED(obj) == 0) {
- char buff[0x100];
- st_data_t cnt = 1;
- char *ptr = buff;
-
- snprintf(ptr, 0x100 - 1, "%s|%s:%d", obj_info(obj), filename, line);
-
- if (st_lookup(rgengc_unprotect_logging_table, (st_data_t)ptr, &cnt)) {
- cnt++;
- }
- else {
- ptr = (strdup)(buff);
- if (!ptr) rb_memerror();
- }
- st_insert(rgengc_unprotect_logging_table, (st_data_t)ptr, cnt);
- }
-}
-
void
rb_copy_wb_protected_attribute(VALUE dest, VALUE obj)
{