-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add upb_Arena_SpaceAllocated function #729
Add upb_Arena_SpaceAllocated function #729
Conversation
This looks good. We should also expose a |
1a70918
to
ca423cb
Compare
Done. |
fa81616
to
84e8f0c
Compare
84e8f0c
to
c144cc6
Compare
upb/arena.h
Outdated
@@ -72,6 +72,8 @@ void upb_Arena_Free(upb_Arena* a); | |||
bool upb_Arena_AddCleanup(upb_Arena* a, void* ud, upb_CleanupFunc* func); | |||
bool upb_Arena_Fuse(upb_Arena* a, upb_Arena* b); | |||
void* _upb_Arena_SlowMalloc(upb_Arena* a, size_t size); | |||
size_t upb_Arena_SpaceAllocated(upb_Arena *arena); | |||
uint_32_t upb_Arena_DebugRefCount(upb_Arena *arena); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue here.
Are you able to run the tests? If you install Bazel you should be able to run:
$ bazel test :all
c144cc6
to
7980b53
Compare
@haberman apologies for not double checking, should be good to go now. |
Would you be able to pull the latest changes from |
7980b53
to
f127673
Compare
Ref: protocolbuffers/protobuf#10291 Ruby types defined though native extensions should register a function that report their memory footprint in bytes. This feature is used by various memory profiling tools.
f127673
to
2341741
Compare
@haberman rebased |
Thanks! |
Ref: protocolbuffers/protobuf#10291
Ruby types defined though native extensions should register
a function that report their memory footprint in bytes.
This feature is used by various memory profiling tools.
As suggested by @haberman.
NB: the implementation is a bit simpler than what we had in protocolbuffers/protobuf#10291, here we return the arena allocated size, but we don't care about fused arenas. I think dividing by the number of fused arena is an implementation detail of the Ruby extension.