diff options
Diffstat (limited to 'core/slice/slice.odin')
| -rw-r--r-- | core/slice/slice.odin | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/slice/slice.odin b/core/slice/slice.odin index cd12a8c70..c31edf281 100644 --- a/core/slice/slice.odin +++ b/core/slice/slice.odin @@ -471,6 +471,12 @@ is_empty :: proc(a: $T/[]$E) -> bool { return len(a) == 0 } +// Gets the byte size of the backing data +@(require_results) +size :: proc "contextless" (a: $T/[]$E) -> int { + return len(a) * size_of(E) +} + @(require_results) |