@lunarised Wanted a chunk of memory anyway? We already had that, it was called static arrays.
Seriously, since a couple years I wonder if one can always replace malloc/free with forks.
I think that it should be possible to prove that you always bind memory to processing, and there is no other reason except programmer lazyness to do such processing in the same process.
Counter-argument: sed hold-space processing.
Counter-counter-argument: you just need more expressive pipes and redirections, and instead of one single hold-space, you'd get multiple spaces each connected to simpler version of sed.
Counter-counter-counter argument: that's cheating, as the pipes would handle memory growth under the hood in kernel space.
But... why not?
Userspace programs would be way simpler (and safer) without malloc/free.
@Shamar @lunarised performance would be trash.
Also, whether it's a static array or malloc, in the end it's all mmap.
Performance: does it really matter when people use editors like vscode?
More interesting question: what you would do to improve performance in such system?
As for mmap: there is no mmap. 😉
That would improve performance wherther you allowed user-space malloc/free or not.
Can't we think anything for such specific os design?
@Shamar @lunarised ok, how about this: fork creates 1000 processes at once. If userspace needs fewer, it should suballocate them somehow.