1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

make g_str_buf a static buffer of size 1K (#3321)

This commit is contained in:
Delyan Angelov 2020-01-04 18:53:37 +02:00 committed by Alexander Medvednikov
parent 7bc5cfc53a
commit 778a1cc34a
2 changed files with 1 additions and 3 deletions

View File

@ -146,7 +146,7 @@ $c_common_macros
#define DEFAULT_GT(a, b) (a > b)
#define DEFAULT_GE(a, b) (a >= b)
//================================== GLOBALS =================================*/
byteptr g_str_buf;
byte g_str_buf[1024];
int load_so(byteptr);
void reload_so();
'

View File

@ -485,7 +485,6 @@ fn (v mut V) generate_init() {
if !v.pref.is_bare {
// vlib can't have `init_consts()`
v.cgen.genln('void init() {
g_str_buf=malloc(1000);
#if VPREALLOC
g_m2_buf = malloc(50 * 1000 * 1000);
g_m2_ptr = g_m2_buf;
@ -596,7 +595,6 @@ pub fn (v mut V) generate_main() {
v.gen_main_start(true)
cgen.genln(' main__main();')
if !v.pref.is_bare {
cgen.genln('free(g_str_buf);')
cgen.genln('#if VPREALLOC')
cgen.genln('free(g_m2_buf);')
cgen.genln('puts("freed mem buf");')