| 2285 | // } |
| 2286 | } |
| 2287 | void CallRegisteredLuaMemHook(unsigned int address, int size, unsigned int value, LuaMemHookType hookType) |
| 2288 | { |
| 2289 | // performance critical! (called VERY frequently) |
| 2290 | // I suggest timing a large number of calls to this function in Release if you change anything in here, |
| 2291 | // before and after, because even the most innocent change can make it become 30% to 400% slower. |
| 2292 | // a good amount to test is: 100000000 calls with no hook set, and another 100000000 with a hook set. |
| 2293 | // (on my system that consistently took 200 ms total in the former case and 350 ms total in the latter case) |
| 2294 | if(hookedRegions[hookType].NotEmpty()) |
| 2295 | { |
| 2296 | //if((hookType <= LUAMEMHOOK_EXEC) && (address >= 0xE00000)) |
| 2297 | // address |= 0xFF0000; // account for mirroring of RAM |
| 2298 | if(hookedRegions[hookType].Contains(address, size)) |
| 2299 | CallRegisteredLuaMemHook_LuaMatch(address, size, value, hookType); // something has hooked this specific address |
| 2300 | } |
| 2301 | } |
| 2302 | |
| 2303 | void CallRegisteredLuaFunctions(LuaCallID calltype) |
| 2304 | { |