Arwalk / zig-protobuf

a protobuf 3 implementation for zig.
MIT License
188 stars 20 forks source link

add `.dupe(allocator)` to every message and default values #23

Closed menduz closed 9 months ago

menduz commented 10 months ago

It recursively copies the message using a new allocator. Useful when working with arenas and multiple threads to prevent memory corruption.

Also introduces the .Empty string type and uses it for the default values of non-nullable strings when calling .init(allocator) or .{}

menduz commented 10 months ago

@Arwalk this is ready to be reviewed