diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2026-02-12 18:26:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-12 18:26:39 +0100 |
| commit | c9f53fdfd70f9b90c9dfca9d01af482ce121d7c4 (patch) | |
| tree | b2a725d684c4da52757591c864828554a919db8d /core/encoding/hxa | |
| parent | 1159110e735ba84d651f4bbc4e9883fd83e9eddc (diff) | |
| parent | c0300a33039ab003cbf105c082fe43de4b17ab96 (diff) | |
Merge pull request #6264 from Kelimion/mem_to_runtime
Replace trivial `core:mem` imports with `base:runtime`.
Diffstat (limited to 'core/encoding/hxa')
| -rw-r--r-- | core/encoding/hxa/hxa.odin | 4 | ||||
| -rw-r--r-- | core/encoding/hxa/read.odin | 3 | ||||
| -rw-r--r-- | core/encoding/hxa/write.odin | 6 |
3 files changed, 5 insertions, 8 deletions
diff --git a/core/encoding/hxa/hxa.odin b/core/encoding/hxa/hxa.odin index 9d0c58196..4ed2001d9 100644 --- a/core/encoding/hxa/hxa.odin +++ b/core/encoding/hxa/hxa.odin @@ -1,6 +1,6 @@ package encoding_hxa -import "core:mem" +import "base:runtime" LATEST_VERSION :: 3 VERSION_API :: "0.3" @@ -16,7 +16,7 @@ Header :: struct #packed { File :: struct { using header: Header, backing: []byte, - allocator: mem.Allocator, + allocator: runtime.Allocator, nodes: []Node, } diff --git a/core/encoding/hxa/read.odin b/core/encoding/hxa/read.odin index 1721bf7fc..29d57838c 100644 --- a/core/encoding/hxa/read.odin +++ b/core/encoding/hxa/read.odin @@ -1,7 +1,6 @@ package encoding_hxa import "core:fmt" -import "core:mem" Read_Error :: enum { None, @@ -45,7 +44,7 @@ read :: proc(data: []byte, filename := "<input>", print_error := false, allocato } ptr := raw_data(r.data[r.offset:]) - value = mem.slice_ptr((^T)(ptr), count) + value = ([^]T)(ptr)[:count] r.offset += size_of(T)*count return } diff --git a/core/encoding/hxa/write.odin b/core/encoding/hxa/write.odin index cbf9c7cb6..0716131f5 100644 --- a/core/encoding/hxa/write.odin +++ b/core/encoding/hxa/write.odin @@ -1,7 +1,5 @@ package encoding_hxa -import "core:mem" - Write_Error :: enum { None, Buffer_Too_Small, @@ -50,7 +48,7 @@ write_internal :: proc(w: ^Writer, file: File) { remaining := len(w.data) - w.offset assert(size_of(T)*len(array) <= remaining) ptr := raw_data(w.data[w.offset:]) - dst := mem.slice_ptr((^T)(ptr), len(array)) + dst := ([^]T)(ptr)[:len(array)] copy(dst, array) } w.offset += size_of(T)*len(array) @@ -60,7 +58,7 @@ write_internal :: proc(w: ^Writer, file: File) { remaining := len(w.data) - w.offset assert(size_of(byte)*len(str) <= remaining) ptr := raw_data(w.data[w.offset:]) - dst := mem.slice_ptr((^byte)(ptr), len(str)) + dst := ([^]byte)(ptr)[:len(str)] copy(dst, str) } w.offset += size_of(byte)*len(str) |