diff options
author | Robb Matzke <matzke@llnl.gov> | 1999-10-15 14:53:57 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1999-10-15 14:53:57 (GMT) |
commit | 34e44e399edd8903f8104f8a6b74e96151150b16 (patch) | |
tree | f2cc428e6292eb4d60646b4e8f47e71f5cec29d8 /src/H5FD.c | |
parent | 5246411f704970a2f6568dc7aaf9e7b5b7269505 (diff) | |
download | hdf5-34e44e399edd8903f8104f8a6b74e96151150b16.zip hdf5-34e44e399edd8903f8104f8a6b74e96151150b16.tar.gz hdf5-34e44e399edd8903f8104f8a6b74e96151150b16.tar.bz2 |
[svn-r1753] Changes since 19991007
----------------------
./configure.in
./src/H5config.h.in [REGENERATED]
The /usr/ncsa/{include,lib} directories are only added if they
actually exist. This fixes a warning on some systems.
Checks for the <pdb.h> header file and also for either the PDB or Silo
library, and if found prepares to compile the pdb2hdf program.
./config/distdep
Relative path names for include files are changed to base names since
the makefile contains the logic for searching and since it's likely
that building the .distdep files happed from a location other than
where they would be used in the file system.
./config/conclude.in
Fixed shell errors when `for' loops iterate over nothing for the
`uninstall' target.
./src/H5D.c
./src/H5Oefl.c
File names for the external files are added to the heap when the
dataset is created instead of when the object header is written. This
fixes a rare infinite recursion bug.
./src/H5FD.c
./src/H5FDpublic.h
Optimization to the free list causes H5FD_alloc() usage to go from >10
seconds to <0.4 second for one example (converting a 30MB equation of
state file from PDB to HDF5 format). The optimization is to simply
keep track of the largest item in the free list and not search the
free list when the largest item is not big enough to satisfy the
request.
./src/H5FDcore.c
./src/H5FDcore.h
./test/h5test.c
If the `backing_store' property is true then a flush causes the entire
contents of memory to be written to the specified file. This is in
preparation for the ASCI/red optimizations and is currently tested by
the pdb2hdf `--cached' switch.
./src/H5Odtypes.c
Wrapped three long lines.
./tools/Makefile.in
./tools/pdb2hdf.c [NEW]
A PDB-to-HDF5 translator. It only translates meta data -- the
resulting HDF5 points into the PDB file for the raw data.
Diffstat (limited to 'src/H5FD.c')
-rw-r--r-- | src/H5FD.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1083,17 +1083,21 @@ H5FD_alloc(H5FD_t *file, H5FD_mem_t type, hsize_t size) /* * Try to satisfy the request from the free list. First try to find an - * exact match, otherwise use the best match. + * exact match, otherwise use the best match. Only perform the search if + * the free list has the potential of satisfying the request. */ - if (mapped_type>=0) { + if (mapped_type>=0 && + (0==file->maxsize || size<=file->maxsize)) { H5FD_free_t *prev=NULL, *best=NULL; H5FD_free_t *cur = file->fl[mapped_type]; while (cur) { + file->maxsize = MAX(file->maxsize, cur->size); if (cur->size==size) { ret_value = cur->addr; if (prev) prev->next = cur->next; else file->fl[mapped_type] = cur->next; H5MM_xfree(cur); + if (size==file->maxsize) file->maxsize=0; /*unknown*/ HRETURN(ret_value); } else if (cur->size>size && (!best || cur->size<best->size)) { @@ -1103,6 +1107,7 @@ H5FD_alloc(H5FD_t *file, H5FD_mem_t type, hsize_t size) cur = cur->next; } if (best) { + if (best->size==file->maxsize) file->maxsize=0; /*unknown*/ ret_value = best->addr; best->addr += size; best->size -= size; @@ -1232,6 +1237,9 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, haddr_t addr, hsize_t size) cur->size = size; cur->next = file->fl[mapped_type]; file->fl[mapped_type] = cur; + if (file->maxsize && size>file->maxsize) { + file->maxsize = size; + } } else if (file->cls->free) { if ((file->cls->free)(file, type, addr, size)<0) { HRETURN_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, |