5
#if defined(__i386) && defined(__GNUC__)
6
#define SET_MACHINE_STACK_END(p) __asm__("mov %%esp, %0" : "=r" (*p))
5
8
NOINLINE(void rb_gc_set_stack_end(VALUE **stack_end_p));
9
#define SET_MACHINE_STACK_END(p) rb_gc_set_stack_end(p)
10
#define USE_CONSERVATIVE_STACK_END
13
NOINLINE(void rb_gc_save_machine_context(rb_thread_t *));
9
#ifndef MARK_FREE_DEBUG
10
#define MARK_FREE_DEBUG 0
17
#ifndef RUBY_MARK_FREE_DEBUG
18
#define RUBY_MARK_FREE_DEBUG 0
15
static int g_indent = 0;
21
#if RUBY_MARK_FREE_DEBUG
22
extern int ruby_gc_debug_indent = 0;
18
25
rb_gc_debug_indent(void)
21
for (i = 0; i < g_indent; i++) {
27
printf("%*s", ruby_gc_debug_indent, "");
27
31
rb_gc_debug_body(char *mode, char *msg, int st, void *ptr)
34
ruby_gc_debug_indent--;
32
36
rb_gc_debug_indent();
33
37
printf("%s: %s %s (%p)\n", mode, st ? "->" : "<-", msg, ptr);
40
ruby_gc_debug_indent++;
40
#define MARK_REPORT_ENTER(msg) rb_gc_debug_body("mark", msg, 1, ptr)
41
#define MARK_REPORT_LEAVE(msg) rb_gc_debug_body("mark", msg, 0, ptr)
42
#define FREE_REPORT_ENTER(msg) rb_gc_debug_body("free", msg, 1, ptr)
43
#define FREE_REPORT_LEAVE(msg) rb_gc_debug_body("free", msg, 0, ptr)
44
#define GC_INFO rb_gc_debug_indent(); printf
46
#define RUBY_MARK_ENTER(msg) rb_gc_debug_body("mark", msg, 1, ptr)
47
#define RUBY_MARK_LEAVE(msg) rb_gc_debug_body("mark", msg, 0, ptr)
48
#define RUBY_FREE_ENTER(msg) rb_gc_debug_body("free", msg, 1, ptr)
49
#define RUBY_FREE_LEAVE(msg) rb_gc_debug_body("free", msg, 0, ptr)
50
#define RUBY_GC_INFO rb_gc_debug_indent(); printf
47
#define MARK_REPORT_ENTER(msg)
48
#define MARK_REPORT_LEAVE(msg)
49
#define FREE_REPORT_ENTER(msg)
50
#define FREE_REPORT_LEAVE(msg)
51
#define GC_INFO if(0)printf
53
#define RUBY_MARK_ENTER(msg)
54
#define RUBY_MARK_LEAVE(msg)
55
#define RUBY_FREE_ENTER(msg)
56
#define RUBY_FREE_LEAVE(msg)
57
#define RUBY_GC_INFO if(0)printf
54
#define MARK_UNLESS_NULL(ptr) if(ptr){rb_gc_mark(ptr);}
55
#define FREE_UNLESS_NULL(ptr) if(ptr){ruby_xfree(ptr);}
60
#define RUBY_MARK_UNLESS_NULL(ptr) if(RTEST(ptr)){rb_gc_mark(ptr);}
61
#define RUBY_FREE_UNLESS_NULL(ptr) if(ptr){ruby_xfree(ptr);}
56
62
#endif /* RUBY_GC_H */