diff options
| author | gingerBill <bill@gingerbill.org> | 2017-11-26 18:36:46 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2017-11-26 18:36:46 +0000 |
| commit | 74fa7ca25ddb4c2fc7a600d0089b1a18f6465b69 (patch) | |
| tree | 4814e2e3a8366c388ef867848bfe05a0346d4121 /src/types.cpp | |
| parent | 5a9223afdac7b97355be6c0441978f12175ede77 (diff) | |
New slice memory layout (ptr+len); `byte`
Diffstat (limited to 'src/types.cpp')
| -rw-r--r-- | src/types.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/types.cpp b/src/types.cpp index f5acd073b..8dae03451 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -327,6 +327,7 @@ gb_global Type *t_untyped_nil = &basic_types[Basic_UntypedNil]; gb_global Type *t_untyped_undef = &basic_types[Basic_UntypedUndef]; + gb_global Type *t_u8_ptr = nullptr; gb_global Type *t_int_ptr = nullptr; gb_global Type *t_i64_ptr = nullptr; @@ -2127,8 +2128,8 @@ i64 type_size_of_internal(gbAllocator allocator, Type *t, TypePath *path) { } break; - case Type_Slice: // ptr + count - return 3 * build_context.word_size; + case Type_Slice: // ptr + len + return 2 * build_context.word_size; case Type_DynamicArray: // data + len + cap + allocator(procedure+data) |