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

live: fix -live compilation && make live_test.v not swallow segfault errors

This commit is contained in:
Delyan Angelov
2020-05-28 03:20:55 +03:00
parent 9cbd9db4e7
commit ae8cc2f433
3 changed files with 18 additions and 18 deletions

View File

@ -20,13 +20,13 @@ pub mut:
reload_time_ms int // how much time the last reload took (compilation + loading)
last_mod_ts int // a timestamp for when the original was last changed
recheck_period_ms int = 100 // how often do you want to check for changes
cb_recheck FNLiveReloadCB = 0 // executed periodically
cb_compile_failed FNLiveReloadCB = 0 // executed when a reload compilation failed
cb_before FNLiveReloadCB = 0 // executed before a reload try happens
cb_after FNLiveReloadCB = 0 // executed after a reload try happened, even if failed
cb_locked_before FNLiveReloadCB = 0 // executed before lib reload, in the mutex section
cb_locked_after FNLiveReloadCB = 0 // executed after lib reload, in the mutex section
user_ptr voidptr = 0 // you can set it to anything, then retrieve it in the cb_ fns
cb_recheck FNLiveReloadCB = voidptr(0) // executed periodically
cb_compile_failed FNLiveReloadCB = voidptr(0) // executed when a reload compilation failed
cb_before FNLiveReloadCB = voidptr(0) // executed before a reload try happens
cb_after FNLiveReloadCB = voidptr(0) // executed after a reload try happened, even if failed
cb_locked_before FNLiveReloadCB = voidptr(0) // executed before lib reload, in the mutex section
cb_locked_after FNLiveReloadCB = voidptr(0) // executed after lib reload, in the mutex section
user_ptr voidptr = voidptr(0) // you can set it to anything, then retrieve it in the cb_ fns
}
// LiveReloadInfo.live_linkfn should be called by the reloader
@ -56,6 +56,7 @@ pub fn info() &LiveReloadInfo {
// started, and the structure LiveReloadInfo will not get updated.
// All its fields will be 0, but still safe to access.
mut x := &LiveReloadInfo{}
C.g_live_info = voidptr(x)
p := &u64(&C.g_live_info)
unsafe { *p = &u64(x) }
return x
}