Critique my non-intrusive heap debugger

后端 未结 3 1684
一整个雨季
一整个雨季 2020-11-30 06:13

This is a follow-up to Critique my heap debugger from yesterday. As suggested by bitc, I now keep metadata about the allocated blocks in a separate handwritten hashtable.

3条回答
  •  佛祖请我去吃肉
    2020-11-30 06:39

    I wonder about the detection of underflows / overflows.

    I mean, if I have a 10 elements arrays, then it seems you'll detect if I write at -1 and 10, but what if I write at 20 ? Underflow or Overflow are not necessarily done as part of a buffer overrun (contiguous).

    Furthermore, what's the point of preventing release of the block ? This block is (relatively) fine, it's the neighbors you've (unfortunately) corrupted.

    Anyway, it seems pretty fine to me, though I would probably have more than one return per function because there's no point in Single Exit. You seem more of a C programmer than a C++ one :)

提交回复
热议问题