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
All append functions in the C backend have their own implementation, instead of calling each other. I guess those grew historically, a cleanup would be welcome :)
Some examples:
BitStream_AppendBitOne --> could call BitStream_AppendBit BitStream_AppendBitZero --> could call BitStream_AppendBit
These 3 share no common implementation, even though they do very similar things. BitStream_AppendNBitZero BitStream_AppendNBitOne BitStream_AppendBits --> calls BitStream_EncodeOctetString_no_length (even though that should be a level above - convenience?)
BitStream_EncodeOctetString_no_length --> can memcpy directly into the bitstream even though the name suggests, that this func does not directly operate on the bitstream (all other encodeXXX do not access the bitstream directly, but through an appendXXX func).
These duplicate each others code, one could call the other. Even the return types are not the same - reason? BitStream_AppendByte BitStream_AppendByte0
BitStream_AppendPartialByte does not call BitStream_AppendBit, even though it could.
BitStream_AppendByteArray does not call BitStream_AppendByte.
The scala backend simplified this - this could be done for C as well. Most functions could be inlined after the hierarchical approach is implemented to satisfy performance requirements.
The text was updated successfully, but these errors were encountered:
All append functions in the C backend have their own implementation, instead of calling each other. I guess those grew historically, a cleanup would be welcome :)
Some examples:
BitStream_AppendBitOne
--> could callBitStream_AppendBit
BitStream_AppendBitZero
--> could callBitStream_AppendBit
These 3 share no common implementation, even though they do very similar things.
BitStream_AppendNBitZero
BitStream_AppendNBitOne
BitStream_AppendBits
--> callsBitStream_EncodeOctetString_no_length
(even though that should be a level above - convenience?)BitStream_EncodeOctetString_no_length
--> can memcpy directly into the bitstream even though the name suggests, that this func does not directly operate on the bitstream (all other encodeXXX do not access the bitstream directly, but through an appendXXX func).These duplicate each others code, one could call the other. Even the return types are not the same - reason?
BitStream_AppendByte
BitStream_AppendByte0
BitStream_AppendPartialByte
does not callBitStream_AppendBit
, even though it could.BitStream_AppendByteArray
does not callBitStream_AppendByte
.The scala backend simplified this - this could be done for C as well. Most functions could be inlined after the hierarchical approach is implemented to satisfy performance requirements.
The text was updated successfully, but these errors were encountered: