Initial support for serialization.#16
Conversation
|
I can't help noticing that you're using a per-stream-allocated buffer, which potentially can be a problem using this in multithreaded environment (although probably in reality it's not, as one still relies on write calls to be sequential to have any meaningful result). Thanks for this contribution! Hope somebody more proficient in go than me can take a look :) |
|
I only did this because the reader is doing the same thing, and it should lead to a reasonable performance benefit for single thread since it will reduce allocations during writing (versus allocating a new buffer per function call.) But yeah, I figure simultaneous multithreading with the same writer is useless due to the issue of only having one cursor; it would only ever interleave and corrupt anyways. So unless I have misunderstood, this should be perfectly safe to do, I believe. |
cugu
left a comment
There was a problem hiding this comment.
I think it's ok to merge. Multithreading is not handled currently anyway.
|
Merging in, thanks, everyone :) |
In a similar vein to kaitai-io/kaitai_struct_cpp_stl_runtime#30, this adds some of the most basic write primitives that would be needed for implementing basic serialization of seqs in Kaitai Struct.