mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-30 15:32:37 +08:00
[svn-r7845] Purpose:
Bug fix. Description: The new routines added for H5MM_[m|c]alloc were causing the function stack code to infinitely recurse while allocating room for the thread-specific information (when thread-safety was turned on). Solution: Call HDmalloc directly instead of H5MM_malloc Platforms tested: FreeBSD 4.9 (sleipnir) Changed are not tested in h5committest
This commit is contained in:
parent
e1792ebb22
commit
18c2554090
@ -27,7 +27,6 @@
|
||||
*/
|
||||
#include "H5private.h" /* Generic Functions */
|
||||
#include "H5FSprivate.h" /* Private function stack routines */
|
||||
#include "H5MMprivate.h" /* Memory management functions */
|
||||
|
||||
#ifdef H5_HAVE_FUNCSTACK
|
||||
|
||||
@ -86,7 +85,7 @@ H5FS_get_stack(void)
|
||||
fstack = pthread_getspecific(H5TS_funcstk_key_g);
|
||||
if (!fstack) {
|
||||
/* no associated value with current thread - create one */
|
||||
fstack = (H5FS_t *)H5MM_calloc(sizeof(H5FS_t));
|
||||
fstack = (H5FS_t *)HDmalloc(sizeof(H5FS_t)); /* Don't use H5MM_malloc() here, it causes infinite recursion */
|
||||
pthread_setspecific(H5TS_funcstk_key_g, (void *)fstack);
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,6 @@
|
||||
*/
|
||||
#include "H5private.h" /* Generic Functions */
|
||||
#include "H5FSprivate.h" /* Private function stack routines */
|
||||
#include "H5MMprivate.h" /* Memory management functions */
|
||||
|
||||
#ifdef H5_HAVE_FUNCSTACK
|
||||
|
||||
@ -86,7 +85,7 @@ H5FS_get_stack(void)
|
||||
fstack = pthread_getspecific(H5TS_funcstk_key_g);
|
||||
if (!fstack) {
|
||||
/* no associated value with current thread - create one */
|
||||
fstack = (H5FS_t *)H5MM_calloc(sizeof(H5FS_t));
|
||||
fstack = (H5FS_t *)HDmalloc(sizeof(H5FS_t)); /* Don't use H5MM_malloc() here, it causes infinite recursion */
|
||||
pthread_setspecific(H5TS_funcstk_key_g, (void *)fstack);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user