You can define the object to represent the continuous block of memory using [alloc0](https://nim-lang.org/docs/system.html#alloc0,Natural) and the size field to indicate its size.
To extract the value at given offset, you can use pointer arithmetic in this [post](https://forum.nim-lang.org/t/1188#7366) To resize vector, you can use [resize](https://nim-lang.org/docs/system.html#resize,ptr.T,Natural). To free the memory you can use `free` or `resize` the block to 0. All `proc` above are not shared version, so make sure the instance not out of scope when using it.