Follow-up from "Dev"
The following discussion from !3 (merged) should be addressed:
-
@kkoci started a discussion: (+1 comment) In general I am not fan of this approach of having write pointer and amount of free space. Those are two values that have to be always in sync. I tend to stay away of variables that has to be in sync at almost all cost because it is easy to get them out of sync. Hunting those types of errors is just terrible.
I would rather go with number of written bytes over this. To get written pointer you just add start pointer and that number and to get free space you just subtract number of written bytes from size of buffer.