Vector

A vector data structure can make use of an extremely sparse memory structure

---------------------------------------------------
| destructor_fn | size | capacity | data[0] | ... |
---------------------------------------------------
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
        Vector Metadata               Vector Data
  • Generally speaking, the user would get back a pointer to the first element of the vector
  • Internal logic will be able to access the memory of the metadata