ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/video_vosf.h
(Generate patch)

Comparing BasiliskII/src/Unix/video_vosf.h (file contents):
Revision 1.28 by cebix, 2001-07-11T19:26:14Z vs.
Revision 1.29 by gbeauche, 2001-07-14T18:41:01Z

# Line 181 | Line 181 | static bool video_vosf_init(void)
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;
# Line 190 | Line 190 | static bool video_vosf_init(void)
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;
# Line 232 | Line 232 | static bool video_vosf_init(void)
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  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines