Re: [AD] stretch_blit problems on WinXP SP2 |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Evert Glebbeek wrote:
Knowing nothing whatsoever about Windows and not using it myself (let alone
on such a system), I haven't tested this. If someone more knowledgeagble
could take a look at it to confirm wether or not it's ok...
It looks mostly okay to me. Although I'm not sure how costly
VirtualProtect is. If it's fairly costly, you may want to add a check to
make sure the memory pointer changed or the size grew:
if(stretcher_info[best].data != _scratch_mem ||
stretcher_info[best].size < _scratch_mem_size)
VirtualProtect(...);
However, it's possible a call to VirtualProtect is negligible and you'd
waste more time checking than with the actual function call.
Also, old_protect's type really should be DWORD instead of int, in case
MS decides to be funny and make DWORD bigger than an int sometime in the
future.
- Kitty Cat