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

RawTable::allocation_info #371

Merged
merged 1 commit into from Nov 9, 2022
Merged

RawTable::allocation_info #371

merged 1 commit into from Nov 9, 2022

Conversation

stepancheg
Copy link
Contributor

We are implementing memory profiler for Rust.

We can approximate how much memory is occupied by RawTable by replicating some logic of RawTable, but it would be more correct/reliable if RawTable just exposed this information.

RawTable::allocation_info returns just that.

It returns both Layout and pointer to allocated memory.

Pointer is helpful when using with jemalloc: the pointer can be passed to malloc_usable_size function to measure precisely not just how much memory is requested by RawTable, but also what is malloc padding for the allocation.

We are implementing memory profiler for Rust.

We can approximate how much memory is occupied by `RawTable` by
replicating some logic of `RawTable`, but it would be more
correct/reliable if `RawTable` just exposed this information.

`RawTable::allocation_info` returns just that.

It returns both `Layout` and pointer to allocated memory.

Pointer is helpful when using with jemalloc: the pointer can be
passed to `malloc_usable_size` function to measure precisely not
just how much memory is requested by `RawTable`, but also what is
malloc padding for the allocation.
@Amanieu
Copy link
Member

Amanieu commented Nov 9, 2022

@bors r+

@bors
Copy link
Collaborator

bors commented Nov 9, 2022

📌 Commit 299b0f6 has been approved by Amanieu

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Nov 9, 2022

⌛ Testing commit 299b0f6 with merge bf272b6...

@bors
Copy link
Collaborator

bors commented Nov 9, 2022

☀️ Test successful - checks-actions
Approved by: Amanieu
Pushing bf272b6 to master...

@bors bors merged commit bf272b6 into rust-lang:master Nov 9, 2022
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.

None yet

3 participants