mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 07:08:48 +00:00
adjust memory allocation
This commit is contained in:
committed by
flysand7
parent
841996435b
commit
f37ec05548
+6
-1
@@ -415,7 +415,12 @@ gb_internal String concatenate4_strings(gbAllocator a, String const &x, String c
|
|||||||
#if defined(GB_SYSTEM_WINDOWS)
|
#if defined(GB_SYSTEM_WINDOWS)
|
||||||
gb_internal String escape_char(gbAllocator a, String s, char cte) {
|
gb_internal String escape_char(gbAllocator a, String s, char cte) {
|
||||||
isize buf_len = s.len;
|
isize buf_len = s.len;
|
||||||
u8 *buf = gb_alloc_array(a, u8, buf_len);
|
isize cte_count = 0;
|
||||||
|
for (isize j = 0; j < s.len; j++)
|
||||||
|
if (s.text[j] == cte)
|
||||||
|
cte_count++;
|
||||||
|
|
||||||
|
u8 *buf = gb_alloc_array(a, u8, buf_len+cte_count);
|
||||||
isize i = 0;
|
isize i = 0;
|
||||||
for (isize j = 0; j < s.len; j++) {
|
for (isize j = 0; j < s.len; j++) {
|
||||||
u8 c = s.text[j];
|
u8 c = s.text[j];
|
||||||
|
|||||||
Reference in New Issue
Block a user