mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: string buffer fix
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user