tolerant heap shim

Signed-off-by: CyberZHG <CyberZHG@gmail.com>