It's much easier to have a reusable data structure which allows you to not make size assumptions and reallocs all over the code which needs to create a dynamic textual response.
On Mon, Dec 7, 2015 at 9:10 AM, Barret Rhoden <[email protected]> wrote: > On 2015-12-07 at 08:59 "'Davide Libenzi' via Akaros" > <[email protected]> wrote: > > OK, dropped all the queue qpread() code 😐 > > But, it is not just a simple buffer. > > In general, you need to be able to build it progressively, without > > using huge-alloc-and-hope semantics. > > For #arch/interrupts, can't you figure out the size of the buffer in > advance? I do something similar in mpstat_len(). Or worst case, you > krealloc or something. > > -- > You received this message because you are subscribed to the Google Groups > "Akaros" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Akaros" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/d/optout.
