diff options
| author | gingerBill <bill@gingerbill.org> | 2020-11-16 15:18:25 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-11-16 15:18:25 +0000 |
| commit | ca4b0527e80bda39aa677f013415eff0c62f433d (patch) | |
| tree | 94220a881bd41166485a733b1f3735cebb967619 /src/entity.cpp | |
| parent | adf6c85fd3130ed22e98f2cf5b7f88079f056488 (diff) | |
Minimize memory usage for AST nodes by using Slice<T> rather than Array<T> when the parameter doesn't need to grow
Diffstat (limited to 'src/entity.cpp')
| -rw-r--r-- | src/entity.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/entity.cpp b/src/entity.cpp index 708b0862c..0aece39c3 100644 --- a/src/entity.cpp +++ b/src/entity.cpp @@ -165,7 +165,7 @@ struct Entity { Scope *scope; } ImportName; struct { - Array<String> paths; + Slice<String> paths; String name; } LibraryName; i32 Nil; @@ -333,7 +333,7 @@ Entity *alloc_entity_import_name(Scope *scope, Token token, Type *type, } Entity *alloc_entity_library_name(Scope *scope, Token token, Type *type, - Array<String> paths, String name) { + Slice<String> paths, String name) { Entity *entity = alloc_entity(Entity_LibraryName, scope, token, type); entity->LibraryName.paths = paths; entity->LibraryName.name = name; |