Commit Graph

3 Commits

Author SHA1 Message Date
Conner Fromknecht
da7cb2d42a
tlv/primitive: use constructor for encoding/decoding type err 2019-08-08 15:57:48 -07:00
Conner Fromknecht
a0ebaeaa6c
tlv: zero alloc encoding for extended types
This commit adds concrete encoding methods for primitive integral types.
When external libs need to create custom encoders, this allows them to
do so without incurring an extra allocation on the heap. Previously, the
need to pass a pointer to the integer using an interface{} would cause
the argument to escape, which we avoid by having them copied directly.
2019-08-07 15:04:08 -07:00
Conner Fromknecht
6773d4770a
tlv/primitive: add primitive encodings 2019-08-07 15:03:30 -07:00