4 ms·
You are making the exact same strawman argument as the post I was responding to. I gave a specific example of how lazy-static solves a specific problem mentione
by bascule 9y ago
You are making the exact same strawman argument as the post I was responding to. I gave a specific example of how lazy-static solves a specific problem mentioned in the paper, and as far as I can see nothing you have said refutes that.
Clearly YMMV as to whether or not you can support a kmalloc()-style API. If you can, allocators will be great for you, and if not they are worthless.
I didn't mean to imply Rust has one-size-fits-all solutions to these problems. Rust provides a lot of solutions to various problems, and it's up to you as the Rust developer to figure out which ones are applicable to your problem at hand.
- belovedeagle 9y agoSo what you're saying is, "if your use-case doesn't support kmalloc then shut up and go away, no statics for you!"? That's ridiculous, inappropriate, and generally unhelpful.
- bascule 9y agoNo, again that's a strawman. To explain it for the third time: I was addressing a specific complaint made in the paper and providing a solution. So far I have not seen any counterarguments against this specific solution to this specific problem. Later I pointed out allocators are a great solution if you're able to use them. Again, if you can't, I'm afraid you're out of luck and I apologize this solution doesn't fit your needs. You can, of course, still make statics, you just won't be able to use Box to conveniently allocate buffers in an automatic and type-safe way. Also check out UnsafeCell if you want to assert as the developer on behalf of your program that you're accessing data in a memory safe way.