Commit bf272b6
committed
Auto merge of #371 - stepancheg:alloc-info, r=Amanieu
RawTable::allocation_info
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.1 file changed
+23
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
521 | 521 | | |
522 | 522 | | |
523 | 523 | | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
524 | 537 | | |
525 | 538 | | |
526 | 539 | | |
| |||
1573 | 1586 | | |
1574 | 1587 | | |
1575 | 1588 | | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
1576 | 1595 | | |
1577 | 1596 | | |
1578 | 1597 | | |
1579 | | - | |
| 1598 | + | |
1580 | 1599 | | |
1581 | | - | |
1582 | | - | |
| 1600 | + | |
| 1601 | + | |
1583 | 1602 | | |
1584 | | - | |
| 1603 | + | |
1585 | 1604 | | |
1586 | 1605 | | |
1587 | 1606 | | |
| |||
0 commit comments