bytedance / mockey

a simple and easy-to-use golang mock library
Apache License 2.0
556 stars 22 forks source link

fix: misusage of runtime.sysAlloc may lead to runtime failure in Go 1.19 #14

Closed Sychorius closed 1 year ago

Sychorius commented 1 year ago

Fix bug: misusage of runtime.sysAlloc may lead to runtime failure in Go 1.19

What type of PR is this?

What this PR does / why we need it (en: English/zh: Chinese):

en: fix AllocatePage bug that may cause runtime crash in Go 1.19+ zh: 修复AllocatePage因为传入的sysStat无法进入runtime的MemStats统计从而runtime获取内存统计时整个运行时崩溃的问题

Which issue(s) this PR fixes:

Fixes https://github.com/bytedance/mockey/issues/13