mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-24 16:04:40 +08:00
Add hashmap for quick retrieval of dim and var
This commit is contained in:
parent
3bb86e417d
commit
d5cb4b9e3e
@ -18,7 +18,7 @@ noinst_HEADERS = nc_logging.h nc_tests.h fbits.h nc.h \
|
||||
nclist.h ncuri.h utf8proc.h ncdispatch.h ncdimscale.h \
|
||||
netcdf_f.h err_macros.h ncbytes.h nchashmap.h ceconstraints.h rnd.h \
|
||||
nclog.h ncconfigure.h nc4internal.h nctime.h nc3dispatch.h nc3internal.h \
|
||||
onstack.h
|
||||
onstack.h nc_hashmap.h
|
||||
|
||||
if USE_NETCDF4
|
||||
noinst_HEADERS += ncaux.h
|
||||
|
@ -15,7 +15,7 @@ endif # BUILD_DLL
|
||||
|
||||
# These files comprise the netCDF-3 classic library code.
|
||||
libnetcdf3_la_SOURCES = v1hpg.c \
|
||||
putget.c attr.c nc3dispatch.c nc3internal.c var.c dim.c ncx.c \
|
||||
putget.c attr.c nc3dispatch.c nc3internal.c var.c dim.c ncx.c nc_hashmap.c \
|
||||
ncx.h lookup3.c pstdint.h ncio.c ncio.h
|
||||
|
||||
if BUILD_DISKLESS
|
||||
|
@ -287,11 +287,11 @@ incr_NC_vararray(NC_vararray *ncap, NC_var *newelemp)
|
||||
else if(ncap->nelems +1 > ncap->nalloc)
|
||||
{
|
||||
vp = (NC_var **) realloc(ncap->value,
|
||||
(ncap->nalloc + NC_ARRAY_GROWBY) * sizeof(NC_var *));
|
||||
(ncap->nalloc * NC_ARRAY_MULT) * sizeof(NC_var *));
|
||||
if(vp == NULL)
|
||||
return NC_ENOMEM;
|
||||
ncap->value = vp;
|
||||
ncap->nalloc += NC_ARRAY_GROWBY;
|
||||
ncap->nalloc *= NC_ARRAY_MULT;
|
||||
}
|
||||
|
||||
if(newelemp != NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user