On Tue, 4 Dec 2001, Jacques GANGLOFF wrote:
> Hi Mark,
>
> Sorry for my rather rough way of programming, butr I am
> newbie in xfree programming.
>
> I send below my modified version of AllocateArea with lots
> of output messages and then the corresponding log file.
> (note that this is the corrected version of the function).
>
> You can note that you can go into the test if(area) ....
> even if a new item in the list has not been allocated
> (search for the string "PROBLEM IS HERE" to find
> the relevant line in the log file")
OK, I see what you're getting at. Yes, the link gets enlisted
twice in that case. I would prefer the following fix, I assume
this fixes the problem you are seeing?
*** xf86fbman.c.old Tue Dec 4 12:40:36 2001
--- xf86fbman.c Tue Dec 4 12:43:49 2001
***************
*** 345,350 ****
--- 345,353 ----
if(!link) return NULL;
area = &(link->area);
+ link->next = offman->UsedAreas;
+ offman->UsedAreas = link;
+ offman->NumUsedAreas++;
break;
}
***************
*** 376,383 ****
REGION_UNION(pScreen, offman->FreeBoxes, offman->FreeBoxes, &NewReg);
REGION_UNINIT(pScreen, &NewReg);
- offman->NumUsedAreas--;
-
area = &(link->area);
break;
}
--- 379,384 ----
***************
*** 397,406 ****
REGION_INIT(pScreen, &NewReg, &(area->box), 1);
REGION_SUBTRACT(pScreen, offman->FreeBoxes, offman->FreeBoxes, &NewReg);
REGION_UNINIT(pScreen, &NewReg);
-
- link->next = offman->UsedAreas;
- offman->UsedAreas = link;
- offman->NumUsedAreas++;
}
return area;
--- 398,403 ----
_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert