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 "H5Eprivate.h"     /* Error handling           */
#ifdef H5_HAVE_CODESTACK
#define H5CS_MIN_NSLOTS 16  /* Minimum number of records in an function stack   */
/* A function stack */
typedef struct H5CS_t {
    unsigned    nused;      /* Number of records currently used in stack */
    unsigned    nalloc;         /* Number of records current allocated for stack */
    const char **rec;           /* Array of function records */
} H5CS_t;
#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