updated on Thu Jan 12 08:01:00 UTC 2012
[aur-mirror.git] / ruby-bleak-house / gc.patch
blob400cf555679cd09ac2afc3a9cda785637d50d5ae
1 Index: parse.y
2 ===================================================================
3 --- parse.y (revision 6446)
4 +++ parse.y (working copy)
5 @@ -6168,6 +6168,11 @@
6 * :wait2, :$>]
7 */
9 +struct st_table *
10 +rb_parse_sym_tbl() {
11 + return sym_tbl;
14 VALUE
15 rb_sym_all_symbols()
17 Index: parse.c
18 ===================================================================
19 --- parse.c (revision 6446)
20 +++ parse.c (working copy)
21 @@ -11157,6 +11157,11 @@
22 * :wait2, :$>]
25 +struct st_table *
26 +rb_parse_sym_tbl() {
27 + return sym_tbl;
30 VALUE
31 rb_sym_all_symbols()
33 Index: gc.c
34 ===================================================================
35 --- gc.c (revision 6446)
36 +++ gc.c (working copy)
37 @@ -260,8 +260,6 @@
41 -#undef GC_DEBUG
43 void
44 rb_global_variable(var)
45 VALUE *var;
46 @@ -296,10 +294,8 @@
47 struct RVarmap varmap;
48 struct SCOPE scope;
49 } as;
50 -#ifdef GC_DEBUG
51 char *file;
52 int line;
53 -#endif
54 } RVALUE;
56 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CYGWIN__)
57 @@ -318,6 +314,22 @@
58 static int heaps_length = 0;
59 static int heaps_used = 0;
61 +struct heaps_slot *
62 +rb_gc_heap_slots()
64 + return heaps;
67 +int
68 +rb_gc_heaps_used() {
69 + return heaps_used;
72 +int
73 +rb_gc_heaps_length() {
74 + return heaps_length;
77 #define HEAP_MIN_SLOTS 10000
78 static int heap_slots = HEAP_MIN_SLOTS;
80 @@ -437,11 +437,14 @@
82 obj = (VALUE)freelist;
83 freelist = freelist->as.free.next;
84 - MEMZERO((void*)obj, RVALUE, 1);
85 -#ifdef GC_DEBUG
86 - RANY(obj)->file = ruby_sourcefile;
87 - RANY(obj)->line = ruby_sourceline;
88 -#endif
90 + MEMZERO((void*)obj, RVALUE, 1);
92 + if (ruby_current_node && ruby_current_node->nd_file) {
93 + RANY(obj)->file = ruby_current_node->nd_file;
94 + RANY(obj)->line = nd_line(ruby_current_node);
95 + }
97 return obj;
100 @@ -732,7 +747,10 @@
101 if (rb_special_const_p(ptr)) return; /* special const not marked */
102 if (obj->as.basic.flags == 0) return; /* free cell */
103 if (obj->as.basic.flags & FL_MARK) return; /* already marked */
105 obj->as.basic.flags |= FL_MARK;
106 + /* mark our new reference point for sourcefile objects */
107 + mark_source_filename(RANY(obj)->file);
109 if (lev > GC_LEVEL_MAX || (lev == 0 && ruby_stack_check())) {
110 if (!mark_stack_overflow) {