Skip to content

Commit

Permalink
dlmalloc: add missing public method doc comments (#23866)
Browse files Browse the repository at this point in the history
  • Loading branch information
virus-rpi authored Mar 5, 2025
1 parent 16681fb commit ae22bcf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vlib/dlmalloc/dlmalloc.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions vlib/dlmalloc/dlmalloc_sys_nix.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions vlib/dlmalloc/dlmalloc_sys_windows.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ae22bcf

Please sign in to comment.