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

builtin: remove an unnecessary malloc() call

This commit is contained in:
Alexander Medvednikov 2019-12-05 11:08:41 +03:00
parent 867f952d6b
commit 6dd1270539

View File

@ -5,11 +5,11 @@
module builtin
fn init() {
$if windows {
$if windows {
if is_atty(0) > 0 {
C._setmode(C._fileno(C.stdin), C._O_U16TEXT)
} else {
C._setmode(C._fileno(C.stdin), C._O_U8TEXT)
C._setmode(C._fileno(C.stdin), C._O_U8TEXT)
}
C._setmode(C._fileno(C.stdout), C._O_U8TEXT)
C.SetConsoleMode(C.GetStdHandle(C.STD_OUTPUT_HANDLE), C.ENABLE_PROCESSED_OUTPUT | 0x0004) // ENABLE_VIRTUAL_TERMINAL_PROCESSING
@ -129,7 +129,6 @@ TODO
print_backtrace()
#endif
*/
free(C.malloc(n))
ptr := C.malloc(n)
if isnil(ptr) {
panic('malloc($n) failed')