Re: FFI question for Gregg
- Posted by ghaberek (admin) Mar 06, 2023
- 1637 views
ChrisB said...
FFI's definition of allocate_string takes one parameter, and the std's definition takes two,
ffi - allocate_string(sequence string) std - allocate_string(sequence string, boolean clean)
Sure, but the distinction is irrelevant. The code in std/ffi.e that allocates strings always calls free() on them later. If I had a cleanup parameter it would never get used. It's not meant to be a complete replacement for the standard library function; it's just enough to avoid repeating myself. The places where that is used will end up in the backend which uses its own C methods for allocating strings.
-Greg