Finding where memory was last freed?

前端 未结 3 2003
夕颜
夕颜 2021-01-19 17:26

Very general: Is there an easy way to tell which line of code last freed a block of memory when an access violation occurs?

Less general:

3条回答
  •  無奈伤痛
    2021-01-19 18:06

    No, not unless you provide your own allocators (e.g. by overloading new/delete) to store this information.

    What profilers do is highly dependent on what they're profiling. I'm not aware of any profiler that tracks what you're looking for.

    Perhaps if you provided more details on your situation people could suggest an alternative means of diagnosing the problem you're encountering.

提交回复
热议问题