Feature #5900
open153: Correct allocation of identifiers using IDR layer
0%
Description
Summary
The module should not delete IDRs which were not initialized and delete IDRs which were already deleted.
Memory allocation, free and find should be done only for already initialized IDRs.
At the end the module should delete with idr_destroy all previously IDRs.
It is allowed to skip idr_destroy for the IDRs which were not changed (i.e. the objects were not allocated and removed).
Description
IDR is initialized with the macro DEFINE_IDR(name) or function void idr_init(struct idr *).
The memory for IDR objects are allocated by int idr_alloc(struct idr *, void *, int, int, gtp_t).
The search for IDR objects is performed with void *idr_find(struct idr *, int).
The memory for an object is free with idr_remove(struct idr *, int).
The IDR is deleted with void idr_destroy(struct idr *).
Links
Sample bugfix c2b4988
No data to display