File tree 3 files changed +4
-0
lines changed
3 files changed +4
-0
lines changed Original file line number Diff line number Diff line change 238
238
release_checks usize
239
239
}
240
240
241
+ // new creates a new instance of `Dlmalloc` with the given system allocator.
241
242
pub fn new (system_allocator Allocator) Dlmalloc {
242
243
return Dlmalloc{
243
244
smallmap: 0
@@ -914,6 +915,7 @@ fn (mut dl Dlmalloc) treemap_is_marked(idx u32) bool {
914
915
return dl.treemap & (1 << idx) != 0
915
916
}
916
917
918
+ // malloc allocates a block of memory of the given size.
917
919
pub fn (mut dl Dlmalloc) malloc (size usize) voidptr {
918
920
unsafe {
919
921
p := dl.malloc_real (size)
Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ fn system_page_size(_ voidptr) usize {
112
112
return 4096
113
113
}
114
114
115
+ // get_system_allocator returns an allocator that uses the system allocator.
115
116
pub fn get_system_allocator () Allocator {
116
117
return Allocator{
117
118
alloc: system_alloc
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ fn system_page_size(_ voidptr) usize {
28
28
return 4096
29
29
}
30
30
31
+ // get_system_allocator returns an allocator that uses the system allocator.
31
32
pub fn get_system_allocator () Allocator {
32
33
return Allocator{
33
34
alloc: system_alloc
You can’t perform that action at this time.
0 commit comments