diff options
| author | Jimmi Holst Christensen <jimmiholstchristensen@gmail.com> | 2018-04-28 19:21:23 +0200 |
|---|---|---|
| committer | Jimmi Holst Christensen <jimmiholstchristensen@gmail.com> | 2018-04-28 19:21:23 +0200 |
| commit | 73bf897b5cc25ee3f1ec9d0ba1483d779de4b7c3 (patch) | |
| tree | 275415c5874eae0993299d6b179797c5a6f50ade /src | |
| parent | d6f033b42dcb49cfe45cb61821f2f451e4004686 (diff) | |
| download | zig-73bf897b5cc25ee3f1ec9d0ba1483d779de4b7c3.tar.gz zig-73bf897b5cc25ee3f1ec9d0ba1483d779de4b7c3.zip | |
Using allocate instead of allocate_nonzero so we don't have to memset
Diffstat (limited to 'src')
| -rw-r--r-- | src/analyze.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index 1003cf8edf..1ecfe32f4c 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -1258,13 +1258,9 @@ void init_fn_type_id(FnTypeId *fn_type_id, AstNode *proto_node, size_t param_cou } fn_type_id->param_count = fn_proto->params.length; - fn_type_id->param_info = allocate_nonzero<FnTypeParamInfo>(param_count_alloc); + fn_type_id->param_info = allocate<FnTypeParamInfo>(param_count_alloc); fn_type_id->next_param_index = 0; fn_type_id->is_var_args = fn_proto->is_var_args; - - // We set param_info to 0, as param_info[i]->type is checked for null - // when checking if a parameters type has been resolved. - memset(fn_type_id->param_info, 0, sizeof(fn_type_id->param_info[0]) * fn_type_id->param_count); } static bool analyze_const_align(CodeGen *g, Scope *scope, AstNode *node, uint32_t *result) { |
