Correct context.allocator usage

This commit is contained in:
gingerBill
2021-09-19 11:59:31 +01:00
parent 2b77f5b72f
commit ceebd7b23c
4 changed files with 18 additions and 10 deletions
+3 -2
View File
@@ -680,10 +680,11 @@ unquote_string :: proc(lit: string, allocator := context.allocator) -> (res: str
return s, false, true
}
}
context.allocator = allocator
buf_len := 3*len(s) / 2
buf := make([]byte, buf_len, allocator)
buf := make([]byte, buf_len)
offset := 0
for len(s) > 0 {
r, multiple_bytes, tail_string, ok := unquote_char(s, byte(quote))