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

all: add stdcall attribute, unhandled exception handler, get_raw_stdin, v_realloc

This commit is contained in:
Emily Hudson
2020-05-29 02:06:27 +01:00
committed by GitHub
parent a849d46e3f
commit f0a9b88ac4
6 changed files with 169 additions and 2 deletions

View File

@ -158,7 +158,16 @@ TODO
print_backtrace()
#endif
*/
}
[unsafe_fn]
pub fn v_realloc(b byteptr, n int) byteptr {
ptr := C.realloc(b, n)
if ptr == 0 {
panic('realloc($n) failed')
}
return ptr
}
pub fn v_calloc(n int) byteptr {