On 8/19/21 1:30 PM, Martin Sebor wrote:
Hey Aldy & Andrew,

I introduced a leak by calling enable_ranger() without pairing it
with one to disable_ranger() on the same function (PR 101984).
I didn't realize (or look to see) that enable_ranger() dynamically
allocates memory.

The patch below adds comments to make it clear that the calls need
to be paired.  That seems obvious now but wasn't before from just
the function names.  So I'm wondering if we might want to rename
them to make it more obvious that the former involves allocating
memory that must be explicitly deallocated.

If you agree, names along the following lines would make this
clearer (to me, anyway) but I'm open to others:

  gimple_ranger *set_new_ranger (function *);
  void release_ranger (function *);


I think the missing comments alone are enough for now.

OK.

Andrew


Reply via email to