diff options
author | Robb Matzke <matzke@llnl.gov> | 1997-08-04 16:19:57 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1997-08-04 16:19:57 (GMT) |
commit | 6a3cb617d3aa57f439065118fbc68afcb1465a54 (patch) | |
tree | b9062c04a678e7615a437afe04fc7ca86f06efc7 /src/H5AC.c | |
parent | 5cc4d0dcde9fb0f5a941c90a1de9ab964d09a163 (diff) | |
download | hdf5-6a3cb617d3aa57f439065118fbc68afcb1465a54.zip hdf5-6a3cb617d3aa57f439065118fbc68afcb1465a54.tar.gz hdf5-6a3cb617d3aa57f439065118fbc68afcb1465a54.tar.bz2 |
[svn-r12] ./src/H5AC.c
Fails sooner if the type of object requested doesn't match
the type of object cached.
./src/H5B.c
./src/H5Bprivate.h
./src/H5Fprivate.h
./src/H5G.c
./src/H5Gnode.c
./src/H5Gprivate.h
./src/H5H.c
./src/H5Hprivate.h
Changed lots of `H5*_HDR_SIZE' macros to `H5*_SIZEOF_HDR' to make
things more consistent.
Added H5*_SIZEOF_MAGIC macros.
Added debugging functions to some of the packages.
./src/H5F.c
Fixed a bug with reading past the end of a buffer.
./src/H5Tproto.h
Added prototypes for H5Tadd_field() and H5Tget_fields().
./src/debug.c
Low-level file debugging program.
./src/Makefile
Builds `debug' as one of the main targets. The target is
called `debug_hdf5' so it doesn't conflict with the `debug'
target that was already there. But the executable is called
`debug'.
Diffstat (limited to 'src/H5AC.c')
-rw-r--r-- | src/H5AC.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -96,6 +96,12 @@ H5AC_dest (hdf5_file_t *f) * * Modifications: * + * Robb Matzke, 4 Aug 1997 + * Fails immediately if the cached object is at the correct address + * but is of the wrong type. This happens if the caller doesn't know + * what type of object is at the address and calls this function with + * various type identifiers until one succeeds (cf., the debugger). + * *------------------------------------------------------------------------- */ void * @@ -119,6 +125,15 @@ H5AC_find (hdf5_file_t *f, const H5AC_class_t *type, haddr_t addr, } /* + * Fail if the item in the cache is at the correct address but is + * of the wrong type. + */ + if (f->cache[idx].type && f->cache[idx].addr==addr && + f->cache[idx].type!=type) { + return NULL; + } + + /* * Load a new thing. If it can't be loaded, then return an error * without preempting anything. */ |