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

compiler: more memory logic + replace "cur_fn &Fn" with "cur_fn Fn"

This commit is contained in:
Alexander Medvednikov
2019-09-09 16:22:39 +03:00
parent f3a74e7d80
commit 9dd86f6fb8
8 changed files with 114 additions and 78 deletions

View File

@ -187,7 +187,7 @@ fn main() {
if v.pref.is_test {
v.run_compiled_executable_and_exit()
}
}
fn (v mut V) compile() {
@ -234,8 +234,8 @@ fn (v mut V) compile() {
imports_json := 'json' in v.table.imports
// TODO remove global UI hack
if v.os == .mac && ((v.pref.build_mode == .embed_vlib && 'ui' in
v.table.imports) || (v.pref.build_mode == .build_module &&
if v.os == .mac && ((v.pref.build_mode == .embed_vlib && 'ui' in
v.table.imports) || (v.pref.build_mode == .build_module &&
v.dir.contains('/ui'))) {
cgen.genln('id defaultFont = 0; // main.v')
}
@ -992,5 +992,5 @@ fn vhash() string {
mut buf := [50]byte
buf[0] = 0
C.snprintf(buf, 50, '%s', C.V_COMMIT_HASH )
return tos_clone(buf)
return tos_clone(buf)
}