nasa / bplib

Apache License 2.0
27 stars 13 forks source link

Allow primary and canonical blocks to contain extra data #110

Closed jphickey closed 2 years ago

jphickey commented 2 years ago

Most memory pool blocks such as flows and refs are allowed to contain extra module-specific data, which can be used to store extra tracking information. In particular it can be helpful to know when the block is deleted/recycled via the help of a destructor callback.

Currently, primary and canonical bundle blocks do not have a facility to allow this. The code internally supports it (via the same mechanisms as other block types) but the API to create these blocks simply does not have the extra parameters to allow it.

Should be as simple as adding a uint32 identifier and initialization argument to the block creation calls for these types.