removed default arguments from virtual_{platform}.odin files

This commit is contained in:
Lukas Arens
2026-04-13 19:28:17 +03:00
parent f2635bbb13
commit 55c592955d
7 changed files with 7 additions and 7 deletions

View File

@@ -2,7 +2,7 @@ package mem_virtual
import "core:sys/posix"
_reserve :: proc "contextless" (size: uint, address_hint := uintptr(0)) -> (data: []byte, err: Allocator_Error) {
_reserve :: proc "contextless" (size: uint, address_hint: uintptr) -> (data: []byte, err: Allocator_Error) {
result := posix.mmap(rawptr(address_hint), size, {}, {.ANONYMOUS, .PRIVATE})
if result == posix.MAP_FAILED {
assert_contextless(posix.errno() == .ENOMEM)

View File

@@ -2,7 +2,7 @@ package mem_virtual
import "core:sys/posix"
_reserve :: proc "contextless" (size: uint, address_hint := uintptr(0)) -> (data: []byte, err: Allocator_Error) {
_reserve :: proc "contextless" (size: uint, address_hint: uintptr) -> (data: []byte, err: Allocator_Error) {
PROT_MAX :: proc "contextless" (flags: posix.Prot_Flags) -> posix.Prot_Flags {
_PROT_MAX_SHIFT :: 16

View File

@@ -4,7 +4,7 @@ package mem_virtual
import "core:sys/linux"
_reserve :: proc "contextless" (size: uint, address_hint := uintptr(0)) -> (data: []byte, err: Allocator_Error) {
_reserve :: proc "contextless" (size: uint, address_hint: uintptr) -> (data: []byte, err: Allocator_Error) {
addr, errno := linux.mmap(address_hint, size, {}, {.PRIVATE, .ANONYMOUS})
if errno == .ENOMEM {
return nil, .Out_Of_Memory

View File

@@ -2,7 +2,7 @@ package mem_virtual
import "core:sys/posix"
_reserve :: proc "contextless" (size: uint, address_hint := uintptr(0)) -> (data: []byte, err: Allocator_Error) {
_reserve :: proc "contextless" (size: uint, address_hint: uintptr) -> (data: []byte, err: Allocator_Error) {
PROT_MPROTECT :: proc "contextless" (flags: posix.Prot_Flags) -> posix.Prot_Flags {
return transmute(posix.Prot_Flags)(transmute(i32)flags << 3)

View File

@@ -2,7 +2,7 @@ package mem_virtual
import "core:sys/posix"
_reserve :: proc "contextless" (size: uint, address_hint := uintptr(0)) -> (data: []byte, err: Allocator_Error) {
_reserve :: proc "contextless" (size: uint, address_hint: uintptr) -> (data: []byte, err: Allocator_Error) {
result := posix.mmap(rawptr(address_hint), size, {}, {.ANONYMOUS, .PRIVATE})
if result == posix.MAP_FAILED {
assert_contextless(posix.errno() == .ENOMEM)

View File

@@ -7,7 +7,7 @@
#+build !windows
package mem_virtual
_reserve :: proc "contextless" (size: uint, address_hint := uintptr(0)) -> (data: []byte, err: Allocator_Error) {
_reserve :: proc "contextless" (size: uint, address_hint: uintptr) -> (data: []byte, err: Allocator_Error) {
return nil, nil
}

View File

@@ -87,7 +87,7 @@ foreign Kernel32 {
}
@(no_sanitize_address)
_reserve :: proc "contextless" (size: uint, address_hint := uintptr(0)) -> (data: []byte, err: Allocator_Error) {
_reserve :: proc "contextless" (size: uint, address_hint: uintptr) -> (data: []byte, err: Allocator_Error) {
result := VirtualAlloc(rawptr(address_hint), size, MEM_RESERVE, PAGE_READWRITE)
if result == nil {
err = .Out_Of_Memory