diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-12-28 16:02:53 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-12-28 16:02:53 -0800 |
| commit | aa3bb50aeca3b7350a41f0538817c49d9656d207 (patch) | |
| tree | 4abafbdc7553e52776394e067fa1ff9a08a14a57 /src/platform/windows/win_thread.c | |
| parent | 838d92deabffbaae1b1a9e447d2088f966078726 (diff) | |
| download | nng-aa3bb50aeca3b7350a41f0538817c49d9656d207.tar.gz nng-aa3bb50aeca3b7350a41f0538817c49d9656d207.tar.bz2 nng-aa3bb50aeca3b7350a41f0538817c49d9656d207.zip | |
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.
Diffstat (limited to 'src/platform/windows/win_thread.c')
| -rw-r--r-- | src/platform/windows/win_thread.c | 9 |
1 files changed, 4 insertions, 5 deletions
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 <stdlib.h> + 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 |
