You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying out the suggestion 3 from here and am wondering if there's a way to get rid of the leading unused bytes this results in without manually moving the buffer to the front and truncating the file afterwards.
From my understanding, the only way to do this would be to know the final size in advance which isn't possible with optional fields.
Am i missing something? How do people usually do this?
I guess only having item 9 from here would enable this?
@dbaileychess can you elaborate on this? What do you mean with afterwards?
After closing mmap create a new mmap with the correct offset, e,g. hint = enoughSpace - builder.GetSize()?
Or leave the mmap open and create a 2nd one over it at the correct memory location?
The former wouldn't make sense i think and the latter did throw an exception within boost::iostreams::detail::mapped_file_impl::try_map_file.
Even if it would work, it would imply copying (most or) all data from one to another disk location, right?
I'm trying out the suggestion 3 from here and am wondering if there's a way to get rid of the leading unused bytes this results in without manually moving the buffer to the front and truncating the file afterwards.
From my understanding, the only way to do this would be to know the final size in advance which isn't possible with optional fields.
Am i missing something? How do people usually do this?
I guess only having item 9 from here would enable this?
Code for reference:
The text was updated successfully, but these errors were encountered: