Open jwerle opened 4 years ago
I'm excited about this one. Hopefully can test later.
One thing that I immediately noticed is that you hardcore the pool size. You can pass a tail argument to the outer strucure instead like:
struct Anything+ { Pool+ p; }
Now you can construct Anything+poolsize
I thought about allowing that at first, but I found it awkward to come up with all the bytes you might need in order to parse command line arguments. Allocations are used for Argument *
pointers and nullterm
string copies of unknown arguments which might be hard for the caller to plan for. I chose 4096
arbitrarily. Would it make sense to allow callers to provide a pointer to a pool they allocated?
Still getting used to the heapless world so I may be completely off base here
https://github.com/zx-project/zx/tree/master/modules/zargv
cc @aep