cgen: string buffer fix
parent
b0cfd3fa67
commit
0f92800921
|
@ -2489,6 +2489,11 @@ fn (mut g Gen) write_init_function() {
|
|||
}
|
||||
fn_vinit_start_pos := g.out.len
|
||||
g.writeln('void _vinit() {')
|
||||
if g.pref.autofree {
|
||||
// Pre-allocate the string buffer
|
||||
// TODO make it configurable
|
||||
g.writeln('g_str_buf = malloc(1024 * 1000);')
|
||||
}
|
||||
g.writeln('\tbuiltin_init();')
|
||||
g.writeln('\tvinit_string_literals();')
|
||||
g.writeln(g.inits.str())
|
||||
|
|
|
@ -240,7 +240,8 @@ void* g_live_info = NULL;
|
|||
#endif
|
||||
|
||||
//================================== GLOBALS =================================*/
|
||||
byte g_str_buf[1024];
|
||||
//byte g_str_buf[1024];
|
||||
byte* g_str_buf;
|
||||
int load_so(byteptr);
|
||||
void reload_so();
|
||||
void _vinit();
|
||||
|
|
Loading…
Reference in New Issue