If Nim side owns the string why dont you just convert it to Nim string in the first place ? Otherwise you have to scan all cstring to query it's size every time but getting cstring pointer out of Nim string is effortless.
- How to define a =copy hook for a distinct cstring type? Isofruit
- How to define a =copy hook for a distinct cstring type? elcritch
- How to define a =copy hook for a distinct cstring type? sky_khan
