|
Boost : |
From: Klemens Morgenstern (klemensdavidmorgenstern_at_[hidden])
Date: 2024-11-16 15:31:52
On Sat, Nov 16, 2024 at 10:41â¯PM Vinnie Falco via Boost
<boost_at_[hidden]> wrote:
>
> On Sat, Nov 16, 2024 at 2:52â¯AM Klemens Morgenstern via Boost
> <boost_at_[hidden]> wrote:
> > I have. error_info contains a string, which allows you to minimizing reallocation by passing it in by reference.
>
> 1. Do you have any measurements to show the performance gains for this, and
> 2. Are you telling us that you "optimized" the case where errors occur?
This is not about performance. You can use sqlite in very resource
constrained environments
and you can configure it so it never mallocs.
The error_info allocates its memory from the same pool and if you
constantly realloc, you'll potentially end up fragmenting this memory.
It's a very common pattern in those cases to allocate all the memory
up front to avoid this fragmentation, and this interface allows that.
It also uses realloc internally for the same reason.
>
> Thanks
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk