summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-12-20 01:44:54 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-12-20 01:44:54 (GMT)
commit4d9201cdca60064094476cff54aa7980624166b6 (patch)
tree8d30736e202958b404bd5e516ba2c4c2108da418
parent69adfc23bd542bece0a1bcfb2f987309f93d52b8 (diff)
downloadhdf5-4d9201cdca60064094476cff54aa7980624166b6.zip
hdf5-4d9201cdca60064094476cff54aa7980624166b6.tar.gz
hdf5-4d9201cdca60064094476cff54aa7980624166b6.tar.bz2
[svn-r18046] Description:
Bring r18045 from trunk to 1.8 branch: Slush changes back & forth between trunk, the merging branch and the metadata journaling branch to level them out to a reasonably common set of code to work from for the next set of more significant changes. Tested on: FreeBSD/32 6.3 (duty) w/debug (h5committested on trunk)
-rw-r--r--src/H5HL.c6
-rw-r--r--src/H5HLcache.c20
-rw-r--r--src/H5HLdbg.c1
-rw-r--r--src/H5HLpkg.h1
4 files changed, 13 insertions, 15 deletions
diff --git a/src/H5HL.c b/src/H5HL.c
index 7e19180..5951509 100644
--- a/src/H5HL.c
+++ b/src/H5HL.c
@@ -470,7 +470,7 @@ H5HL_remove_free(H5HL_t *heap, H5HL_free_t *fl)
*
* Return: Success: Offset of new item within heap.
*
- * Failure: (size_t)(-1)
+ * Failure: UFAIL
*
* Programmer: Robb Matzke
* matzke@llnl.gov
@@ -617,7 +617,7 @@ H5HL_insert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t buf_size, const void *
offset = heap->heap_alloc;
if(need_more - need_size >= H5HL_SIZEOF_FREE(f)) {
if(NULL == (fl = H5FL_MALLOC(H5HL_free_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, (size_t)(-1), "memory allocation failed")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, UFAIL, "memory allocation failed")
fl->offset = heap->heap_alloc + need_size;
fl->size = need_more - need_size;
HDassert(fl->offset == H5HL_ALIGN(fl->offset));
@@ -646,7 +646,7 @@ H5HL_insert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t buf_size, const void *
#endif
heap->heap_alloc = new_heap_alloc;
if(NULL == (heap->chunk = H5FL_BLK_REALLOC(lheap_chunk, heap->chunk, (sizeof_hdr + heap->heap_alloc))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, UFAIL, "memory allocation failed")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, UFAIL, "memory allocation failed")
/* Clear new section so junk doesn't appear in the file */
/* (Avoid clearing section which will be overwritten with newly inserted data) */
diff --git a/src/H5HLcache.c b/src/H5HLcache.c
index 6c2b3dc..fc3a5dc 100644
--- a/src/H5HLcache.c
+++ b/src/H5HLcache.c
@@ -204,19 +204,19 @@ H5HL_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * udata1,
/* Check magic number */
if(HDmemcmp(hdr, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC))
- HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "bad heap signature")
+ HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "bad heap signature")
p += H5_SIZEOF_MAGIC;
/* Version */
if(H5HL_VERSION != *p++)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "wrong version number in global heap")
+ HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "wrong version number in global heap")
/* Reserved */
p += 3;
/* Allocate space in memory for the heap */
if(NULL == (heap = H5FL_CALLOC(H5HL_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed")
/* heap data size */
H5F_DECODE_LENGTH(f, p, heap->heap_alloc);
@@ -224,22 +224,22 @@ H5HL_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * udata1,
/* free list head */
H5F_DECODE_LENGTH(f, p, free_block);
if(free_block != H5HL_FREE_NULL && free_block >= heap->heap_alloc)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "bad heap free list")
+ HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "bad heap free list")
/* data */
H5F_addr_decode(f, &p, &(heap->addr));
if(NULL == (heap->chunk = H5FL_BLK_CALLOC(lheap_chunk, (sizeof_hdr + heap->heap_alloc))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed")
if(heap->heap_alloc &&
H5F_block_read(f, H5FD_MEM_LHEAP, heap->addr, heap->heap_alloc, dxpl_id, heap->chunk + sizeof_hdr) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "unable to read heap data")
+ HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "unable to read heap data")
/* Build free list */
while(H5HL_FREE_NULL != free_block) {
if(free_block >= heap->heap_alloc)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "bad heap free list")
+ HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, NULL, "bad heap free list")
if(NULL == (fl = H5FL_MALLOC(H5HL_free_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed")
fl->offset = free_block;
fl->prev = tail;
fl->next = NULL;
@@ -253,11 +253,11 @@ H5HL_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * udata1,
H5F_DECODE_LENGTH(f, p, free_block);
if(free_block == 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "free block size is zero?")
+ HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "free block size is zero?")
H5F_DECODE_LENGTH(f, p, fl->size);
if(fl->offset + fl->size > heap->heap_alloc)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL, "bad heap free list")
+ HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, NULL, "bad heap free list")
} /* end while */
/* Set return value */
diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c
index 2e8af43..6bf35ad 100644
--- a/src/H5HLdbg.c
+++ b/src/H5HLdbg.c
@@ -22,7 +22,6 @@
#include "H5private.h" /* Generic Functions */
-#include "H5ACprivate.h" /* Metadata cache */
#include "H5Eprivate.h" /* Error handling */
#include "H5HLpkg.h" /* Local heaps */
#include "H5Iprivate.h" /* ID Functions */
diff --git a/src/H5HLpkg.h b/src/H5HLpkg.h
index 1e34a48..50cb4ed 100644
--- a/src/H5HLpkg.h
+++ b/src/H5HLpkg.h
@@ -32,7 +32,6 @@
#include "H5HLprivate.h"
/* Other private headers needed by this file */
-#include "H5ACprivate.h" /* Metadata cache */
#include "H5FLprivate.h" /* Free lists */