Critique my heap debugger

后端 未结 5 1401
梦谈多话
梦谈多话 2021-01-03 03:06

I wrote the following heap debugger in order to demonstrate memory leaks, double deletes and wrong forms of deletes (i.e. trying to delete an array with delete p

5条回答
  •  攒了一身酷
    2021-01-03 03:50

    void* raw = static_cast(payload) - ALIGNMENT;
    

    If payload has been already deleted, wouldn't that make this undefined behavior?

提交回复
热议问题