Skip to content
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

Heap size #18

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Heap size #18

wants to merge 2 commits into from

Conversation

heavyk
Copy link

@heavyk heavyk commented Jul 15, 2019

I was implementing the memory usage function of a redis module data type that used RM_CreateDict. RM_DictSize just returns the numele, and I needed the actual bytes for the memory usage. nothing like it exists in the code, so I implemented it. it may be useful to export the function to redis modules so they can report the dictionary memory size if a custom type uses it (my use case exactly).

the function is quite simple, combining the raxTouch function, summing raxNodeCurrentLength on every node. it should be working properly. I thought about doing a redefinition of malloc/realloc which stores the length before the pointer as shown here, but I'm pretty sure the implementation is correct.

thanks,
kenny

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant