|
From: Jeremy F. <je...@go...> - 2005-02-15 01:18:59
|
On Mon, 2005-02-14 at 18:44 -0600, Nicholas Nethercote wrote: > And you have to call mprotect whenever you switch between generated code > and Valgrind code, right? That could be expensive. No! The table would be an array of single pages, each of which is a proxy for a whole superblock. You'd only need to change their protections when you allocate a superblock for client use. Come to think of it, if there are only a small number of superpages, then just mprotecting them on entry/exit to generated code would be pretty cheap (since you'd only have to do the Valgrind one(s), which is at most one mprotect per superblock, and fewer if they're contiguous). It might get expensive if there are lots of syscalls, but it would save on extra code per memory reference... J |