Two allocation traps are always enabled/disabled together. If both traps belong to the same page, protect/unprotect it just once.
| 39 | // Two allocation traps are always enabled/disabled together. |
| 40 | // If both traps belong to the same page, protect/unprotect it just once. |
| 41 | void Trap::pair(Trap& second) { |
| 42 | if (_page_start[_id] == _page_start[second._id]) { |
| 43 | _protect = false; |
| 44 | second._unprotect = false; |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | // Patch instruction at the entry point |
| 49 | bool Trap::patch(instruction_t insn) { |