aboutsummaryrefslogtreecommitdiff
path: root/src/types.c
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-02-07 00:10:58 +0000
committerGinger Bill <bill@gingerbill.org>2017-02-07 00:10:58 +0000
commit219ca0ac4677235d595d9bd6e1be08eedfdf7d66 (patch)
tree453fc6cb9bd0e8ecc0952cde48994b67b779c08d /src/types.c
parent5796c413571140798d9ca597cda4d34c6762eabe (diff)
Map type info and fmt printing
Diffstat (limited to 'src/types.c')
-rw-r--r--src/types.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/types.c b/src/types.c
index be28c82f0..eae9ec556 100644
--- a/src/types.c
+++ b/src/types.c
@@ -300,6 +300,7 @@ gb_global Type *t_type_info_struct = NULL;
gb_global Type *t_type_info_union = NULL;
gb_global Type *t_type_info_raw_union = NULL;
gb_global Type *t_type_info_enum = NULL;
+gb_global Type *t_type_info_map = NULL;
gb_global Type *t_type_info_named_ptr = NULL;
@@ -320,6 +321,7 @@ gb_global Type *t_type_info_struct_ptr = NULL;
gb_global Type *t_type_info_union_ptr = NULL;
gb_global Type *t_type_info_raw_union_ptr = NULL;
gb_global Type *t_type_info_enum_ptr = NULL;
+gb_global Type *t_type_info_map_ptr = NULL;
@@ -1561,8 +1563,7 @@ i64 type_align_of_internal(BaseTypeSizes s, gbAllocator allocator, Type *t, Type
case Type_Map: {
if (t->Map.count == 0) { // Dynamic
- // NOTE(bill): same as a dynamic array
- return s.word_size;
+ return type_align_of_internal(s, allocator, t->Map.generated_struct_type, path);
}
GB_PANIC("TODO(bill): Fixed map alignment");
} break;
@@ -1778,8 +1779,7 @@ i64 type_size_of_internal(BaseTypeSizes s, gbAllocator allocator, Type *t, TypeP
case Type_Map: {
if (t->Map.count == 0) { // Dynamic
- // NOTE(bill): same as a two dynamic arrays
- return 2 * type_size_of_internal(s, allocator, t_raw_dynamic_array, path);
+ return type_size_of_internal(s, allocator, t->Map.generated_struct_type, path);
}
GB_PANIC("TODO(bill): Fixed map size");
}