summaryrefslogtreecommitdiffstats
path: root/src/H5CS.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2014-06-19 20:09:06 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2014-06-19 20:09:06 (GMT)
commit67ba5eb6e8a71a110d47fd3079edcc1fe09fb95f (patch)
tree92735056c19013281c6ba687e836ed59772e2f3e /src/H5CS.c
parent02eab2eb72a18fa685545ba7c7c5ac7715693d1b (diff)
downloadhdf5-67ba5eb6e8a71a110d47fd3079edcc1fe09fb95f.zip
hdf5-67ba5eb6e8a71a110d47fd3079edcc1fe09fb95f.tar.gz
hdf5-67ba5eb6e8a71a110d47fd3079edcc1fe09fb95f.tar.bz2
[svn-r25333] Bring revisions #24948 - #25120 from trunk to revise_chunks.
Tested on jam, ostrich, koala, platypus.
Diffstat (limited to 'src/H5CS.c')
-rw-r--r--src/H5CS.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/H5CS.c b/src/H5CS.c
index 4ccd0f8..29182ce 100644
--- a/src/H5CS.c
+++ b/src/H5CS.c
@@ -83,12 +83,16 @@ H5CS_get_stack(void)
fstack = H5TS_get_thread_local_value(H5TS_funcstk_key_g);
if (!fstack) {
- /* no associated value with current thread - create one */
- fstack = (H5CS_t *)HDmalloc(sizeof(H5CS_t)); /* Don't use H5MM_malloc() here, it causes infinite recursion */
+ /* No associated value with current thread - create one */
+#ifdef H5_HAVE_WIN_THREADS
+ fstack = (H5CS_t *)LocalAlloc(LPTR, sizeof(H5CS_t)); /* Win32 has to use LocalAlloc to match the LocalFree in DllMain */
+#else
+ fstack = (H5CS_t *)HDmalloc(sizeof(H5CS_t)); /* Don't use H5MM_malloc() here, it causes infinite recursion */
+#endif /* H5_HAVE_WIN_THREADS */
HDassert(fstack);
/* Set the thread-specific info */
- fstack->nused=0;
+ fstack->nused=0;
/* (It's not necessary to release this in this API, it is
* released by the "key destructor" set up in the H5TS