Repository: lucy-clownfish Updated Branches: refs/heads/thread_safe_errors 78f6a18a2 -> c5e90d666
Initialize error globals to zero Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/46eb7151 Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/46eb7151 Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/46eb7151 Branch: refs/heads/thread_safe_errors Commit: 46eb7151fb628e1b69023315096b0702ec8bbd54 Parents: 78f6a18 Author: Nick Wellnhofer <[email protected]> Authored: Wed Dec 24 18:06:39 2014 +0100 Committer: Nick Wellnhofer <[email protected]> Committed: Wed Dec 24 18:06:39 2014 +0100 ---------------------------------------------------------------------- runtime/c/src/Clownfish/Err.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/46eb7151/runtime/c/src/Clownfish/Err.c ---------------------------------------------------------------------- diff --git a/runtime/c/src/Clownfish/Err.c b/runtime/c/src/Clownfish/Err.c index a6e5090..69b9b79 100644 --- a/runtime/c/src/Clownfish/Err.c +++ b/runtime/c/src/Clownfish/Err.c @@ -70,7 +70,7 @@ S_get_globals() { = (cfish_ErrGlobals*)TlsGetValue(err_globals_tls_index); if (!globals) { - globals = (cfish_ErrGlobals*)MALLOCATE(sizeof(cfish_ErrGlobals)); + globals = (cfish_ErrGlobals*)CALLOCATE(1, sizeof(cfish_ErrGlobals)); if (!TlsSetValue(err_globals_tls_index, globals)) { fprintf(stderr, "TlsSetValue failed: %d\n", GetLastError()); abort(); @@ -115,7 +115,7 @@ S_get_globals() { = (cfish_ErrGlobals*)pthread_getspecific(err_globals_key); if (!globals) { - globals = (cfish_ErrGlobals*)MALLOCATE(sizeof(cfish_ErrGlobals)); + globals = (cfish_ErrGlobals*)CALLOCATE(1, sizeof(cfish_ErrGlobals)); int error = pthread_setspecific(err_globals_key, globals); if (error) { fprintf(stderr, "pthread_setspecific failed: %d\n", error);
