fstack = (H5CS_t *)LocalAlloc(LPTR, sizeof(H5CS_t)); /* Win32 has to use LocalAlloc to match the LocalFree in DllMain */
 
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Copyright by The HDF Group.                                               *
 * Copyright by the Board of Trustees of the University of Illinois.         *
 * All rights reserved.                                                      *
 *                                                                           *
 * This file is part of HDF5.  The full HDF5 copyright notice, including     *
 * terms governing use, modification, and redistribution, is contained in    *
 * the COPYING file, which can be found at the root of the source code       *
 * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.  *
 * If you do not have access to either file, you may request a copy from     *
 * help@hdfgroup.org.                                                        *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
 * Purpose: Provides internal function tracing in the form of a stack.
 *      The FUNC_ENTER() macro adds the function name to the function
 *              stack whenever a function is entered.
 *      As the functions return with FUNC_LEAVE,
 *      entries are removed from the stack.
 *
 *      A function stack has a fixed maximum size.  If this size is
 *      exceeded then the stack will be truncated and only the
 *      first called functions will have entries on the stack. This is
 *      expected to be a rare condition.
 *
 */
#include "H5private.h"      /* Generic Functions            */
#include "H5CSprivate.h"    /* Function stack           */
#include "H5MMprivate.h"    /* Memory management            */
#ifdef H5_HAVE_CODESTACK
#ifdef H5_HAVE_THREADSAFE
/*
 * The per-thread function stack. pthread_once() initializes a special
 * key that will be used by all threads to create a stack specific to
 * each thread individually. The association of stacks to threads will
 * be handled by the pthread library.
 *
 * In order for this macro to work, H5CS_get_my_stack() must be preceeded
 * by "H5CS_t *fstack =".
 */
static H5CS_t *H5CS_get_stack(void);
#define H5CS_get_my_stack()  H5CS_get_stack()
#else /* H5_HAVE_THREADSAFE */
/*
 * The function stack.  Eventually we'll have some sort of global table so each
 * thread has it's own stack.  The stacks will be created on demand when the
 * thread first calls H5CS_push().  */