File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ documentation = "https://docs.rs/buddy_system_allocator"
5
5
homepage = " https://github.com/rcore-os/buddy_system_allocator"
6
6
repository = " https://github.com/rcore-os/buddy_system_allocator"
7
7
keywords = [" allocator" , " no_std" , " heap" ]
8
- version = " 0.3.9 "
8
+ version = " 0.4.0 "
9
9
authors = [" Jiajie Chen <noc@jiegec.ac.cn>" ]
10
10
edition = " 2018"
11
11
license = " MIT"
Original file line number Diff line number Diff line change @@ -190,6 +190,21 @@ impl Heap {
190
190
self . user -= layout. size ( ) ;
191
191
self . allocated -= size;
192
192
}
193
+
194
+ /// Return the number of bytes that user requests
195
+ pub fn stats_alloc_user ( & self ) -> usize {
196
+ self . user
197
+ }
198
+
199
+ /// Return the number of bytes that are actually allocated
200
+ pub fn stats_alloc_actual ( & self ) -> usize {
201
+ self . allocated
202
+ }
203
+
204
+ /// Return the total number of bytes in the heap
205
+ pub fn stats_total_bytes ( & self ) -> usize {
206
+ self . total
207
+ }
193
208
}
194
209
195
210
impl fmt:: Debug for Heap {
You can’t perform that action at this time.
0 commit comments