Skip to content

Fix malloc_size_of for mac #93

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

Merged
merged 44 commits into from
May 31, 2019
Merged

Conversation

cheme
Copy link
Collaborator

@cheme cheme commented Jan 14, 2019

This PR changes the way macos is handled by malloc_size of (in #89 the test was not activated and I did not see the failure for macos).
When no allocator is set macos will use estimate-heapsize (the tests are pretty bad looking but I did not find a better alternative).
Note that I would rather call the system allocator but did not know if the equivalent of 'malloc_size' is exposed anywhere.

If jemalloc is set macos will use jemalloc sizeof (this is the target for parity ethereum).

This PR also allows usage of MallocSizeOf trait on MemoryDB and mark old mem_used method as deprecated.
The related future changes for parity-ethereum would be : openethereum/parity-ethereum@master...cheme:rem_heapsize .

cheme and others added 27 commits December 6, 2018 19:41
`get_malloc_size_src.sh`.
Add missing impls.rs with ethereum types related implementation.
Fix a no_std deps issue.
Documentation enhancements.
Explicits imports.
@ordian
Copy link
Member

ordian commented Jan 14, 2019

I would personally go for a breaking change approach (I guess uint's version needs to be bumped as well, since a feature is removed? Not sure about patricia_trie though).

@cheme
Copy link
Collaborator Author

cheme commented Jan 14, 2019

I did not see uint 0.6.0 published on crates.io, so it is probably fine not to increment. For patricia_trie the dependency is a test dependency, so I think there is no need.

@cheme cheme mentioned this pull request Jan 14, 2019
@cheme cheme changed the title malloc_size_of on memorydb Fix malloc_size_of for macos Jan 22, 2019
@cheme cheme changed the title Fix malloc_size_of for macos Fix malloc_size_of for mac Jan 22, 2019
@cheme
Copy link
Collaborator Author

cheme commented Feb 22, 2019

Since memory-db and patriciatrie has moved to trie, this pr no longer allows usage of MallocSizeOf trait on MemoryDB and mark old mem_used method as deprecated.
A PR in trie will be needed.
Edit: trie diff for PR after publish: paritytech/trie@master...cheme:deprecate_heapsize

@ordian
Copy link
Member

ordian commented Mar 20, 2019

Just discovered https://github.com/Aeledfyr/deepsize (similar to estimate-heapsize), although it seems to be unmaintained.

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

Successfully merging this pull request may close these issues.

4 participants