Skip to content

Commit

Permalink
ruby-prof is expecting rb_gc_malloc_allocat(ed_size|ions) with the rb…
Browse files Browse the repository at this point in the history
…_ prefix
  • Loading branch information
goncalossilva committed Mar 24, 2011
1 parent d113d3a commit 4b72f88
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions patches/1.9.2/p180/gcdata.patch
@@ -1,5 +1,5 @@
--- a/gc.c
+++ b/gc.c
--- gc.c (revision 31173)
+++ gc.c (working copy)
@@ -291,16 +291,12 @@
struct gc_list *next;
};
Expand Down Expand Up @@ -94,7 +94,25 @@
/*
* call-seq:
* GC.malloc_allocated_size -> Integer
@@ -3028,7 +2999,6 @@
@@ -3008,8 +2979,8 @@
* It returns the allocated size by malloc().
*/

-static VALUE
-gc_malloc_allocated_size(VALUE self)
+VALUE
+rb_gc_malloc_allocated_size(VALUE self)
{
return UINT2NUM((&rb_objspace)->malloc_params.allocated_size);
}
@@ -3023,12 +2994,11 @@
* It returns the number of allocated memory object by malloc().
*/

-static VALUE
-gc_malloc_allocations(VALUE self)
+VALUE
+rb_gc_malloc_allocations(VALUE self)
{
return UINT2NUM((&rb_objspace)->malloc_params.allocations);
}
Expand All @@ -106,8 +124,8 @@
rb_define_singleton_method(rb_mGC, "stress", gc_stress_get, 0);
rb_define_singleton_method(rb_mGC, "stress=", gc_stress_set, 1);
rb_define_singleton_method(rb_mGC, "count", gc_count, 0);
+ rb_define_singleton_method(rb_mGC, "malloc_allocated_size", gc_malloc_allocated_size, 0);
+ rb_define_singleton_method(rb_mGC, "malloc_allocations", gc_malloc_allocations, 0);
+ rb_define_singleton_method(rb_mGC, "malloc_allocated_size", rb_gc_malloc_allocated_size, 0);
+ rb_define_singleton_method(rb_mGC, "malloc_allocations", rb_gc_malloc_allocations, 0);
rb_define_method(rb_mGC, "garbage_collect", rb_gc_start, 0);

rb_mProfiler = rb_define_module_under(rb_mGC, "Profiler");
Expand Down

0 comments on commit 4b72f88

Please sign in to comment.