From 4b410534dd88e22e7d4e54ecbe44f9b8d334f367 Mon Sep 17 00:00:00 2001 From: kalapalo Date: Mon, 5 Oct 2020 07:14:41 -0400 Subject: [PATCH] cgen: add C fn memfreedup to cheaders.v (#6563) --- vlib/v/gen/cheaders.v | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vlib/v/gen/cheaders.v b/vlib/v/gen/cheaders.v index 8eed5626b6..306232a869 100644 --- a/vlib/v/gen/cheaders.v +++ b/vlib/v/gen/cheaders.v @@ -407,6 +407,12 @@ void _vcleanup(); return ((r&0x1fffff)+((r>>21)&0x1fffff)+((r>>42)&0x1fffff))*_wynorm-3.0; } #endif + +voidptr memdup(voidptr src, int sz); +voidptr memfreedup(voidptr ptr, voidptr src, int sz) { + free(ptr); + return memdup(src, sz); +} ' c_builtin_types = ' //================================== builtin types ================================*/