Ruby implement memsize functions for native types
Fix: https://github.com/protocolbuffers/protobuf/issues/10280
This allows Ruby to report a more correct estimation of the memory used by these objects.
It's useful when running memory profilers against applications.
cc @zhangskz @haberman
@haberman thanks. I updated Arena_memsize according to your suggestions.
Thanks for the changes. Would you be able to submit the ruby-upb.c/.h changes to https://github.com/protocolbuffers/upb/blob/main/upb/arena.h and https://github.com/protocolbuffers/upb/blob/main/upb/arena.c, which is that code's primary location.
We can create a new function upb_Arena_SpaceAllocated() that is then called from here.
. Would you be able to submit the ruby-upb.c/.h changes to ...
Done! https://github.com/protocolbuffers/upb/pull/729
If you rebase on main it should pick up the upb_Arena_SpaceAllocated() function that is there now.
Rebeased.
I think we need one more rebase here (I think this conflicted with your other change).
Oh wow, I had forgotten about this one. I'll rebase.
Done.
The Ruby 2.6 test failed with:
ruby/ext/google/protobuf_c/protobuf.c:417: void ObjectCache_Add(const void *, VALUE): Assertion `ObjectCache_Get(key) == val' failed. Aborted (core dumped)
It's hard to see how this PR would have caused that error. I'll try re-running that test.
We triage inactive PRs and issues in order to make it easier to find active work. If this PR should remain active, please add a comment.
This PR is labeled inactive because the last activity was over 90 days ago. This PR will be closed and archived after 14 additional days without activity.