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:
parent
7bc5cfc53a
commit
778a1cc34a
@ -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();
|
||||
'
|
||||
|
@ -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");')
|
||||
|
Loading…
Reference in New Issue
Block a user