For the sake of the integration of development tools, would it not be better to
actually provide a fully programmatic interface and *then* adapt the normal
Profiler to handle it ? What I have in mind is the following:

 * add some events that can be caught through the normal event interface, like
   RAN_GC, NEW_OBJECT
 * add a few rb_gc methods:
   * get the cound of objects per classes like below
   * get the structure of the heaps
   * get the total count of objects

I think that would always be a better approach because external tools would be
able to do memory profiling, and we would be able to use good visualization
tools (like kcachegrind as supported by the ruby-prof gem)

Best regards,
Sylvain