Rev 105 | Rev 135 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 105 | Rev 106 | ||
---|---|---|---|
Line 29... | Line 29... | ||
29 | struct node *tree[4]; |
29 | struct node *tree[4]; |
30 | char *err[4]; |
30 | char *err[4]; |
31 | int errpos[4],errstart[4],nplanes,cnvused,chunksize,toprow; |
31 | int errpos[4],errstart[4],nplanes,cnvused,chunksize,toprow; |
32 | value_type slider[8],cell[0x100],map[4][0x100]; |
32 | value_type slider[8],cell[0x100],map[4][0x100]; |
33 | char *expr[4]; |
33 | char *expr[4]; |
34 | long maxSpace; |
34 | // long maxSpace; |
35 | globals_t *gdata; |
35 | globals_t *gdata; |
36 | FilterRecordPtr gpb; |
36 | FilterRecordPtr gpb; |
37 | 37 | ||
38 | #ifdef MAC_ENV |
38 | #ifdef MAC_ENV |
39 | #define hDllInstance NULL /* fake this Windows-only global */ |
39 | #define hDllInstance NULL /* fake this Windows-only global */ |
Line 161... | Line 161... | ||
161 | return f || showdialog; |
161 | return f || showdialog; |
162 | } |
162 | } |
163 | 163 | ||
164 | void DoPrepare(FilterRecordPtr pb){ |
164 | void DoPrepare(FilterRecordPtr pb){ |
165 | int i; |
165 | int i; |
166 | long space = (pb->maxSpace*9)/10; // don't ask for more than 90% of available memory |
- | |
167 | 166 | ||
168 | for(i = 4; i--;){ |
167 | for(i = 4; i--;){ |
169 | if(expr[i]||tree[i]) DBG("expr[] or tree[] non-NULL in Prepare!"); |
168 | if(expr[i]||tree[i]) DBG("expr[] or tree[] non-NULL in Prepare!"); |
170 | expr[i] = NULL; |
169 | expr[i] = NULL; |
171 | tree[i] = NULL; |
170 | tree[i] = NULL; |
172 | } |
171 | } |
- | 172 | ||
- | 173 | // Commented out by DM, 18 Dec 2018: |
|
- | 174 | // This code did not work on systems with 8 GB RAM: |
|
- | 175 | /* |
|
- | 176 | long space = (pb->maxSpace*9)/10; // don't ask for more than 90% of available memory |
|
- | 177 | ||
173 | maxSpace = 512L<<10; // this is a wild guess, actually |
178 | maxSpace = 512L<<10; // this is a wild guess, actually |
174 | if(maxSpace > space) |
179 | if(maxSpace > space) |
175 | maxSpace = space; |
180 | maxSpace = space; |
176 | pb->maxSpace = maxSpace; |
181 | pb->maxSpace = maxSpace; |
- | 182 | */ |
|
- | 183 | ||
- | 184 | // New variant: |
|
- | 185 | // TODO: Programmatically test if host supports pb->maxSpace64, and if it does so, use this value instead. |
|
- | 186 | pb->maxSpace = ((double)pb->maxSpace/10)*9; // don't ask for more than 90% of available memory |
|
177 | } |
187 | } |
178 | 188 | ||
179 | void RequestNext(FilterRecordPtr pb,long toprow){ |
189 | void RequestNext(FilterRecordPtr pb,long toprow){ |
180 | /* Request next block of the image */ |
190 | /* Request next block of the image */ |
181 | 191 |