Bryce Mecum wrote:
Hi Eric, could you elaborate on what you mean by this?
> as ChunkedArray is being built via the API.
Sharing some code, either here or as a link might be helpful.
What I want to do is basically:
void _check_chunk_space(size_t len) {
auto new_len = get_builder().???maximum length of any buffer???
+ len;
if (new_len >= max_len_per_chunk) {
next_chunk();
}
}
And next_chunk() here would do Finish() on get_builder() and then
construct a new Builder for the next chunk.
-Eric
On Thu, Jul 4, 2024 at 11:12 AM Eric Jacobs <[email protected]
<mailto:[email protected]>> wrote:
Hi,
I would like to build a ChunkedArray but I need to limit the maximum
size of each buffer (somewhere in the low MB's). Ending the current
chunk and starting a new one is straightforward, but I'm having some
difficulty detecting when the current buffer(s) are close to getting
full. If I had the Builders I could check the length() as they are
going
along, but I'm not sure how I can get access to those as
ChunkedArray is
being built via the API.
The size control doesn't have to be precise in my case; it just
needs to
be conservative as a limit (i.e. the builder cannot go over X MB)
Any advice would be appreciated.
Thanks,
-Eric