mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-04-18 18:20:39 +08:00
It turns out that the chunksize used in the ncio-related code must be a multiple of eight in size. Both memio.c and mmapio.c were potentially violating this constraint. See also pr https://github.com/Unidata/netcdf-c/pull/400
This commit is contained in:
parent
8dddd222a3
commit
6dc6cf65ba
@ -385,6 +385,10 @@ fprintf(stderr,"memio_open: initial memory: %lu/%lu\n",(unsigned long)memio->mem
|
||||
/* Use half the filesize as the blocksize ; why? */
|
||||
sizehint = filesize/2;
|
||||
|
||||
/* sizehint must be multiple of 8 */
|
||||
sizehint = (sizehint / 8) * 8;
|
||||
if(sizehint < 8) sizehint = 8;
|
||||
|
||||
fd = nc__pseudofd();
|
||||
*((int* )&nciop->fd) = fd;
|
||||
|
||||
|
@ -373,6 +373,10 @@ fprintf(stderr,"mmapio_open: initial memory: %lu/%lu\n",(unsigned long)mmapio->m
|
||||
/* Use half the filesize as the blocksize */
|
||||
sizehint = filesize/2;
|
||||
|
||||
/* sizehint must be multiple of 8 */
|
||||
sizehint = (sizehint / 8) * 8;
|
||||
if(sizehint < 8) sizehint = 8;
|
||||
|
||||
fd = nc__pseudofd();
|
||||
*((int* )&nciop->fd) = fd;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user