Avoid reallocation in emit_bit
#40
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TOPIO/BigWhoop#40
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We could spare the reallocation in
emit_bit
if thestream
is guaranteed to have the correct size. The only usage ofemit_bit
is taking theheader
variable increate_packet
of tier2. Thememory
ofheader
is initially allocated to PACKET_HEADER_SIZE=512.A test that used two times the
PACKET_HEADER_SIZE
could avoid reallocation inemit_bit
.Generally,
PACKET_HEADER_SIZE
is variable and would have to be calculated to avoid dynamic reallocation.How could we do such a calculation?