Skip to content

Commit ae22bcf

Browse files
authored
dlmalloc: add missing public method doc comments (#23866)
1 parent 16681fb commit ae22bcf

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

vlib/dlmalloc/dlmalloc.v

+2
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ mut:
238238
release_checks usize
239239
}
240240

241+
// new creates a new instance of `Dlmalloc` with the given system allocator.
241242
pub fn new(system_allocator Allocator) Dlmalloc {
242243
return Dlmalloc{
243244
smallmap: 0
@@ -914,6 +915,7 @@ fn (mut dl Dlmalloc) treemap_is_marked(idx u32) bool {
914915
return dl.treemap & (1 << idx) != 0
915916
}
916917

918+
// malloc allocates a block of memory of the given size.
917919
pub fn (mut dl Dlmalloc) malloc(size usize) voidptr {
918920
unsafe {
919921
p := dl.malloc_real(size)

vlib/dlmalloc/dlmalloc_sys_nix.c.v

+1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ fn system_page_size(_ voidptr) usize {
112112
return 4096
113113
}
114114

115+
// get_system_allocator returns an allocator that uses the system allocator.
115116
pub fn get_system_allocator() Allocator {
116117
return Allocator{
117118
alloc: system_alloc

vlib/dlmalloc/dlmalloc_sys_windows.c.v

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ fn system_page_size(_ voidptr) usize {
2828
return 4096
2929
}
3030

31+
// get_system_allocator returns an allocator that uses the system allocator.
3132
pub fn get_system_allocator() Allocator {
3233
return Allocator{
3334
alloc: system_alloc

0 commit comments

Comments
 (0)