Skip to main content
edited title
Link
Ripleys 0x
  • 338
  • 1
  • 7

Recommend Recommended serialization library for dynamically sized objects

Source Link
Ripleys 0x
  • 338
  • 1
  • 7

Recommend serialization library for dynamically sized objects

I am trying to write a vector of objects into a solana account. The problem is, the pre-allocated size of the account might be too small for my vector. I know i can re-size the account with realloc, but I still don't know the serialized size of my vector of objects, which I need to call realloc.

I could implement my own serialization logic, but I'd prefer not to do that.

Are there any serialization libraries out there that tell you the size of the serialized object before you serialize it?