Skip to content

Commit

Permalink
Fix vm_resize_heap documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
maximecb committed Oct 11, 2023
1 parent 559f612 commit 746be88
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions api/syscalls.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@
]
],
"returns": [
"bool",
"success"
"u64",
"new_size"
],
"permission": "default_allowed",
"const_idx": 17,
"description": "Resize the heap to a new size given in bytes. This is similar to the `brk()` system call on POSIX systems. Note that the heap may be resized to a size larger than requested. The heap size is guaranteed to be a multiple of at least 8 bytes. Returns the new heap size in bytes if successful, or `UINT64_MAX` on failure."
"description": "Resize the heap to a new size given in bytes. This is similar to the `brk()` system call on POSIX systems. Note that the heap may be resized to a size larger than requested. The heap size is guaranteed to be a multiple of 8 bytes. Returns the new heap size in bytes if successful, or `UINT64_MAX` on failure."
}
],
"constants": []
Expand Down
6 changes: 3 additions & 3 deletions doc/syscalls.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ Report the current heap size in bytes.
## vm_resize_heap

```
bool vm_resize_heap(u64 num_bytes)
u64 vm_resize_heap(u64 num_bytes)
```

**Returns:** `bool success`
**Returns:** `u64 new_size`

Resize the heap to a new size given in bytes. This is similar to the `brk()` system call on POSIX systems. Note that the heap may be resized to a size larger than requested. The heap size is guaranteed to be a multiple of at least 8 bytes. Returns the new heap size in bytes if successful, or `UINT64_MAX` on failure.
Resize the heap to a new size given in bytes. This is similar to the `brk()` system call on POSIX systems. Note that the heap may be resized to a size larger than requested. The heap size is guaranteed to be a multiple of 8 bytes. Returns the new heap size in bytes if successful, or `UINT64_MAX` on failure.

# io

Expand Down
6 changes: 3 additions & 3 deletions ncc/include/uvm/syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
// Report the current heap size in bytes.
#define vm_heap_size() asm () -> u64 { syscall vm_heap_size; }

// bool vm_resize_heap(u64 num_bytes)
// Resize the heap to a new size given in bytes. This is similar to the `brk()` system call on POSIX systems. Note that the heap may be resized to a size larger than requested. The heap size is guaranteed to be a multiple of at least 8 bytes. Returns the new heap size in bytes if successful, or `UINT64_MAX` on failure.
#define vm_resize_heap(__num_bytes) asm (__num_bytes) -> bool { syscall vm_resize_heap; }
// u64 vm_resize_heap(u64 num_bytes)
// Resize the heap to a new size given in bytes. This is similar to the `brk()` system call on POSIX systems. Note that the heap may be resized to a size larger than requested. The heap size is guaranteed to be a multiple of 8 bytes. Returns the new heap size in bytes if successful, or `UINT64_MAX` on failure.
#define vm_resize_heap(__num_bytes) asm (__num_bytes) -> u64 { syscall vm_resize_heap; }

// void print_i64(i64 val)
// Print an i64 value to standard output.
Expand Down

0 comments on commit 746be88

Please sign in to comment.