Skip to content

Can the number of bytes used in a builder object be estimated/returned before the buffer is closed out? #244

Answered by mikkelfj
randyK-HH asked this question in Q&A
Discussion options

You must be logged in to vote

To your last side question first. Unlike other languages, flatcc allows for having multiple tables open at once, however, they must be nested. You cannot have an arbitrary number of unrelated tables open at once. This is because all unclosed tables share the same stack.

The stack leads to your first question:

Get buffer size should be valid before the end of the entire buffer, but maybe not that exact function call you refer to - there is an end and start method (or something to that effect - look at the source) used extensively internally. These are the virtual start and end offset that grow up and down and eventally extends to the entire buffer and defines the buffer size. But these onl…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@randyK-HH
Comment options

@mikkelfj
Comment options

@mikkelfj
Comment options

@mikkelfj
Comment options

Answer selected by randyK-HH
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants