-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested
Description
@Ahbork We have discussed adding a binding for lib/csp/src/csp_iflist.c:238 csp_iflist_remove(). This is quite simple to do, but libcsp does not offer any way to free the memory of interfaces, which may allocate some additional context driver, that may also need to be freed.
The interface (or its driver) could also be static, I which case attempting to free it would segfault.
There's a couple of ways to solve this, all of which are very likely compatible with eachother at the API level:
- I think the best would be if interfaces could register a
free()function. But this requires changes to all interface types, and to upstream; a lot of work. - Alternatively we just don't free the interface. Python
Interfaceinstances would remain valid, and anInterface.csp_iflist_add()could be added, so they could be registered again. But if all Python references to thecsp_iface_tare lost, we would leak the memory. Nevertheless, this is probably my preferred initial solution. - We could also have Python maintain a list of all interfaces it has ever removed, so that the references are never truly lost. But I don't see an issue in adding this later.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested