From 6dd1270539075882c83fff97886b3cdb3aeecaa2 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Thu, 5 Dec 2019 11:08:41 +0300 Subject: [PATCH] builtin: remove an unnecessary malloc() call --- vlib/builtin/builtin.v | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vlib/builtin/builtin.v b/vlib/builtin/builtin.v index 8943fc2d8e..b06f5a9c4f 100644 --- a/vlib/builtin/builtin.v +++ b/vlib/builtin/builtin.v @@ -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')