mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-04-12 17:31:09 +08:00
[svn-r9592] Purpose:
Bug fix Description: Re-work array of 'forward' pointers in a way that makes the PGI compiler more happy. Solution: Change from 'H5SL_node_t *forward[1]' to 'H5SL_node_t **forward' and change how array of forward pointers is dealt with. Platforms tested: Linux 2.4 (verbena) w/PGI FreeBSD 4.10 (sleipnir) Configuration not tested w/h5committest
This commit is contained in:
parent
9f4d8be1d1
commit
3e99d8411c
@ -114,7 +114,7 @@ struct H5SL_node_t {
|
||||
void *key; /* Pointer to node's key */
|
||||
void *item; /* Pointer to node's item */
|
||||
size_t level; /* The level of this node */
|
||||
struct H5SL_node_t *forward[1]; /* Array of forward pointers from this node */
|
||||
struct H5SL_node_t **forward; /* Array of forward pointers from this node */
|
||||
};
|
||||
|
||||
/* Main skip list data structure */
|
||||
@ -245,13 +245,14 @@ H5SL_new_node(size_t lvl, void *item, void *key)
|
||||
FUNC_ENTER_NOAPI_NOINIT(H5SL_new_node);
|
||||
|
||||
/* Allocate the node */
|
||||
if((ret_value=H5MM_malloc(sizeof(H5SL_node_t)+(sizeof(H5SL_node_t *)*lvl)))==NULL)
|
||||
if((ret_value=H5MM_malloc(sizeof(H5SL_node_t)+(sizeof(H5SL_node_t *)*(lvl+1))))==NULL)
|
||||
HGOTO_ERROR(H5E_SLIST,H5E_NOSPACE,NULL,"memory allocation failed");
|
||||
|
||||
/* Initialize node */
|
||||
ret_value->key=key;
|
||||
ret_value->item=item;
|
||||
ret_value->level=lvl;
|
||||
ret_value->forward=(H5SL_node_t **)((unsigned char *)ret_value+sizeof(H5SL_node_t));
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user