Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:cgeb
ruby-railsexpress
04-track-live-dataset-size.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 04-track-live-dataset-size.patch of Package ruby-railsexpress
diff --git a/gc.c b/gc.c index 7673687..4d9ca88 100644 --- gc.c.orig +++ gc.c @@ -248,7 +248,6 @@ getrusage_time(void) } while(0) #endif - #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CYGWIN__) #pragma pack(push, 1) /* magic for reducing sizeof(RVALUE): 24 -> 20 */ #endif @@ -355,6 +354,7 @@ typedef struct rb_objspace { unsigned LONG_LONG gc_num_allocations; unsigned long live_objects; unsigned LONG_LONG allocated_objects; + unsigned long heap_slots_live_after_last_gc; } rb_objspace_t; #if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE @@ -388,6 +388,7 @@ int *ruby_initial_gc_stress_ptr = &rb_objspace.gc_stress; #define gc_num_allocations objspace->gc_num_allocations #define live_objects objspace->live_objects #define allocated_objects objspace->allocated_objects +#define heap_slots_live_after_last_gc objspace->heap_slots_live_after_last_gc #define finalizer_table objspace->final.table #define deferred_final_list objspace->final.deferred #define mark_stack objspace->markstack.buffer @@ -1410,6 +1411,24 @@ rb_gc_time() #endif } +/* + * call-seq: + * GC.heap_slots_live_after_last_gc => Integer + * + * Returns the number of heap slots which were live after the last garbage collection. + * + * GC.heap_slots_live_after_last_gc #=> 231223 + * + */ +VALUE +rb_gc_heap_slots_live_after_last_gc() +{ + rb_objspace_t *objspace = &rb_objspace; + return ULONG2NUM(heap_slots_live_after_last_gc); +} + + + VALUE rb_mGC; void @@ -2616,6 +2635,7 @@ gc_sweep(rb_objspace_t *objspace) } during_gc = 0; live_objects = live; + heap_slots_live_after_last_gc = live; /* log gc stats if requested */ if (do_gc_stats) { @@ -3961,6 +3981,7 @@ Init_GC(void) rb_define_singleton_method(rb_mGC, "allocated_size", rb_gc_allocated_size, 0); rb_define_singleton_method(rb_mGC, "num_allocations", rb_gc_num_allocations, 0); rb_define_singleton_method(rb_mGC, "heap_slots", rb_gc_heap_slots, 0); + rb_define_singleton_method(rb_mGC, "heap_slots_live_after_last_gc", rb_gc_heap_slots_live_after_last_gc, 0); rb_define_const(rb_mGC, "HEAP_SLOT_SIZE", INT2FIX(sizeof(RVALUE))); rb_define_singleton_method(rb_mGC, "log", rb_gc_log, 1);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor