dlmalloc: add missing public method doc comments (#23866)

This commit is contained in:
Noa Santo 2025-03-05 13:22:17 +01:00 committed by GitHub
parent 16681fbd6b
commit ae22bcfad9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 0 deletions

View File

@ -238,6 +238,7 @@ mut:
release_checks usize
}
// new creates a new instance of `Dlmalloc` with the given system allocator.
pub fn new(system_allocator Allocator) Dlmalloc {
return Dlmalloc{
smallmap: 0
@ -914,6 +915,7 @@ fn (mut dl Dlmalloc) treemap_is_marked(idx u32) bool {
return dl.treemap & (1 << idx) != 0
}
// malloc allocates a block of memory of the given size.
pub fn (mut dl Dlmalloc) malloc(size usize) voidptr {
unsafe {
p := dl.malloc_real(size)

View File

@ -112,6 +112,7 @@ fn system_page_size(_ voidptr) usize {
return 4096
}
// get_system_allocator returns an allocator that uses the system allocator.
pub fn get_system_allocator() Allocator {
return Allocator{
alloc: system_alloc

View File

@ -28,6 +28,7 @@ fn system_page_size(_ voidptr) usize {
return 4096
}
// get_system_allocator returns an allocator that uses the system allocator.
pub fn get_system_allocator() Allocator {
return Allocator{
alloc: system_alloc