mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-18 15:55:12 +08:00
Addressed issues related to running large file tests on machines < 4GB memory. Updated messages to indicate what the problem was specifically, so that I don't spend another day somewhere down the road figuring out the problem yet again.
This commit is contained in:
parent
841729d2ec
commit
1593fccd69
@ -119,6 +119,10 @@ main(int argc, char **argv) {
|
||||
//static float var1[J_LEN];
|
||||
static float *var1 = NULL;
|
||||
var1 = malloc(sizeof(float)*J_LEN);
|
||||
if(!var1) {
|
||||
printf("Malloc failed. This may happen on systems with < 4GB. THIS TEST DID NOT PASS, but is returning 0.\n");
|
||||
return 0;
|
||||
}
|
||||
static size_t var1_start[RANK_var1] = {0, 0, 0};
|
||||
static size_t var1_count[RANK_var1] = {1, 1, J_LEN};
|
||||
static size_t x_start[RANK_x] = {0, 0};
|
||||
|
@ -72,6 +72,7 @@ main(int argc, char **argv)
|
||||
memory = malloc(filesize);
|
||||
if(memory == NULL) {
|
||||
fprintf(stderr,"Cannot malloc %lu bytes\n",(unsigned long)filesize);
|
||||
fprintf(stderr,"This may mean your machine does not have enough RAM. If this is the case, it is safe to ignore this error.\n");
|
||||
exit(1);
|
||||
}
|
||||
free(memory);
|
||||
|
Loading…
Reference in New Issue
Block a user