sinojelly / mockcpp

Two C/C++ testing tools, mockcpp and testngpp.
Apache License 2.0
66 stars 39 forks source link

bug: linux use large page memory, function stubs failed #36

Closed github-my closed 2 years ago

github-my commented 2 years ago

mprotect for change function head instructions in memory. current code use 4K size page, in normal machine should be OK; but in large page (such as 2M size) mechine, mprotect system call return failed, because memory size not in bound. so here gives a fix, read page size from kernel config, then set mprotect the right size. image

sinojelly commented 2 years ago

Is it also work ok on other platforms?