|
|
|
|
|
by kazinator
2604 days ago
|
|
How does this know the difference between: const char *cls::func(void)
{
return "abc"; // static: caller must not free
}
and const char *cls::func(void)
{
return strdup("abc"); // caller must free
}
Edit: I see: designed for large scale programs in high performance computing that use modern C++.Modern C++ meaning, no pointers anywhere. |
|
So you handle it like any other ctypes pointer, ie. `libc = ctypes.CDLL(find_library("c")); libc.free(ptr)`
Which is not fun in Python. So yeah, better avoid raw pointers.