mirror of
https://github.com/vlang/v.git
synced 2025-09-09 07:15:50 -04:00
dlmalloc: add missing public method doc comments (#23866)
This commit is contained in:
parent
16681fbd6b
commit
ae22bcfad9
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user