There is a daemon for executing commands in conditions where the target server is already half dead: the memory has run out, descriptors, some other failure has occurred and even bash cannot start. At the moment, the utility is written in C with its own memory allocator (it stores it in advance - when everything is in order and then it works with the block already received).
I want to rewrite to rust for ease of expansion. However, my own allocators have not yet entered the standard and cannot use them.
The tasks that need to be done are small and I’ll have enough memory on the stack, without allocating it in the heap. Actually the question is: How can I write code on rust-stable that will work without add. memory queries?
stdlib
can guarantee the absence of heaps: rurust.imtqy.com/rust_book_ru/src/no-stdlib.html . I advise you to ask in English stack - can someone from the developers answer. - aSpexVec::with_capacity(usize)
and similar constructors for containers to store the necessary amount of memory in advance. - kstep