#9 Heap reallocation for custom formatters

Unstable (example)
wont-fix
None
5
2013-09-29
2011-12-09
dpv
No

This provided patch allows a custom formatter to reallocate the event buffer on the heap. Our custom formatter would normally take the stack allocated buffer but sometimes has to reallocate a larger buffer on the heap. Applying the provided patch and by making sure that the custom formatter sets the evt.evt_buffer.buf_maxsize variable to 0, it is now possible to reallocate on the heap without leaking.

Discussion

  • dpv

    dpv - 2011-12-09
     
  • František Dvořák

    • assigned_to: nobody --> valtri
     
  • František Dvořák

    It looks to me this patch is not needed, or even it would break things. Currently, formaters can set buf_maxsize to 0 and use malloc() to allocate the new buffer, which should be freed later.

     
  • František Dvořák

    • status: open --> wont-fix
    • Group: --> Unstable (example)
     
  • František Dvořák

    alloca() is used only for buffer with the limit set, otherwise the heap is used. I think the patch is not needed.

    Feel free to reopen this ticket, if am I wrong. :-)

     

Log in to post a comment.