181 |
|
// The "2" more bytes requested are a safety net to insure the |
182 |
|
// loops in the update routines will terminate. |
183 |
|
// See "How can we deal with array overrun conditions ?" hereunder for further details. |
184 |
< |
mainBuffer.dirtyPages = (char *) vm_acquire(mainBuffer.pageCount + 2); |
185 |
< |
if (mainBuffer.dirtyPages == VM_MAP_FAILED) |
184 |
> |
mainBuffer.dirtyPages = (char *) malloc(mainBuffer.pageCount + 2); |
185 |
> |
if (mainBuffer.dirtyPages == NULL) |
186 |
|
return false; |
187 |
|
|
188 |
|
PFLAG_CLEAR_ALL; |
190 |
|
PFLAG_SET(mainBuffer.pageCount+1); |
191 |
|
|
192 |
|
// Allocate and fill in pageInfo with start and end (inclusive) row in number of bytes |
193 |
< |
mainBuffer.pageInfo = (ScreenPageInfo *) vm_acquire(mainBuffer.pageCount * sizeof(ScreenPageInfo)); |
194 |
< |
if (mainBuffer.pageInfo == VM_MAP_FAILED) |
193 |
> |
mainBuffer.pageInfo = (ScreenPageInfo *) malloc(mainBuffer.pageCount * sizeof(ScreenPageInfo)); |
194 |
> |
if (mainBuffer.pageInfo == NULL) |
195 |
|
return false; |
196 |
|
|
197 |
|
uint32 a = 0; |
232 |
|
|
233 |
|
static void video_vosf_exit(void) |
234 |
|
{ |
235 |
< |
if (mainBuffer.pageInfo != VM_MAP_FAILED) { |
236 |
< |
vm_release(mainBuffer.pageInfo, mainBuffer.pageCount * sizeof(ScreenPageInfo)); |
237 |
< |
mainBuffer.pageInfo = (ScreenPageInfo *) VM_MAP_FAILED; |
235 |
> |
if (mainBuffer.pageInfo) { |
236 |
> |
free(mainBuffer.pageInfo); |
237 |
> |
mainBuffer.pageInfo = NULL; |
238 |
|
} |
239 |
< |
if (mainBuffer.dirtyPages != VM_MAP_FAILED) { |
240 |
< |
vm_release(mainBuffer.dirtyPages, mainBuffer.pageCount + 2); |
241 |
< |
mainBuffer.dirtyPages = (char *) VM_MAP_FAILED; |
239 |
> |
if (mainBuffer.dirtyPages) { |
240 |
> |
free(mainBuffer.dirtyPages); |
241 |
> |
mainBuffer.dirtyPages = NULL; |
242 |
|
} |
243 |
|
} |
244 |
|
|