On further thought, having the comment here to begin with only adds confusion.
While slices don't have as trivial of a memory layout as other pointer types, they're still language primitives…
Comment needs clarify as it appears slightly misleading / ambiguous in its current wording.
Worth mentioning that it performs linear time, making it O(n) time complexity?
Warrants TODO
comment mentioning that this stdlib dependency should be removed in future.
Reallocation could benefit from the same kind of last-alloc check optimization as deallocation.
Seeing as FixedStack
does not depend on any kind of dynamic allocation directly, does it make sense to make PushError
a direct alias of io.MakeError
?
Since this function is only ever used to check if the load factor is at / beyond its maximum, would it make more sense to replace it with isMaxLoad(Self) bool
or something like that which meets the requirements of it uses more precisely?