Open
Description
Problem:
s2n_stuffer and s2n_blob have confusingly non-normalized fields.
s2n_stuffer
defines growable
and allocd
fields.
s2n_blob
also defines growable
and allocated
fields.
The semantics of this are very confusing. What would it mean for an allocated stuffer to have a non-allocated blob? Isn't "allocated-ness" purely a property of the blob?
Solution:
After some investigation with #4943, my understanding is as follows.
- s2n_blob should remove the
growable
field. This is extensively documented in the above PR, but essentially, any blob that is alloced is growable. If it isn't alloced, it isn't growable. - s2n_stuffer should remove the
allocd
field. I was playing around with some unit tests, and I was able to make this change with breaking any unit tests. But trying to removegrowable
from the stuffer broke lots of things, which makes sense.
stuffer "growable" semantics are used to deliberately fail writes that are too large. This is a valuable behavior that we want to keep. (but this logic should be documented in the code 🙂)
Requirements / Acceptance Criteria:
- remove
growable
froms2n_blob
. - remove
alloced
froms2n_stuffer
.
And preferably add some comments about why the fields exist and what they accomplish.
Activity