From aa3bb50aeca3b7350a41f0538817c49d9656d207 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 28 Dec 2017 16:02:53 -0800 Subject: Fix compilation warnings, bugs, and crashes found on Windows. This addresses a number of problems that were found on Windows, including one bug that actually turned up in testing on POSIX. --- src/platform/windows/win_thread.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/platform/windows/win_thread.c') diff --git a/src/platform/windows/win_thread.c b/src/platform/windows/win_thread.c index 0d9e7387..6cfb4162 100644 --- a/src/platform/windows/win_thread.c +++ b/src/platform/windows/win_thread.c @@ -14,20 +14,19 @@ #ifdef NNG_PLATFORM_WINDOWS +#include + void * nni_alloc(size_t sz) { - void *v; - - v = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sz); - return (v); + return (calloc(sz, 1)); } void nni_free(void *b, size_t z) { NNI_ARG_UNUSED(z); - HeapFree(GetProcessHeap(), 0, b); + free(b); } void -- cgit v1.2.3-70-g09d2