-
Notifications
You must be signed in to change notification settings - Fork 589
Open
Description
These questions apply to both embedded JIT mode as well as to "as a shared library" mode.
On Codon side:
extern
def f1(s:str) -> str
On C++ side
struct CodonString {
seq_int_t len;
char *str;
};
extern "C" CodonString f2( CodonString s);
Questions:
- C++ side invokes f1:
- Who owns string memory in incoming argument
s? If it's codon - can C++ "ref count" it and later unref or it must copy ? - Who owns string memory of return string? C++ has generated this string by allocating it with
seq_alloc_atomic. But who will release it and when?
- Codon side invokes f2:
- Who owns string memory in
s? - Who owns string memory of return string?
These rules must be explained and documented.
Thanks!
Metadata
Metadata
Assignees
Labels
No labels