If there is `stable_grow` why there is no `stable_shrink`?

As the title says.

By the way, did anyone get luck trying to implement stable memory collections for rust?

1 Like

The IC’s stable memory API is modelled after Wasm’s memory model and is a stop gap measure until we can expose it directly as a proper memory inside Wasm (blocking on Wasm’s long-due multi-memory proposal landing in the standard).

For a variety of reasons, Wasm does not currently support shrinking memory, although that keeps being discussed. It’s a fairly tricky problem, though.

3 Likes