Create callback_list in drcontainers and switch to dynamic callback priorities in drmgr
Created by: byron-hawkins
The new Dr. Fuzz feature of Dr. Memory (xref drmem #1734) needs a generic callback list. Since drmgr already has one, we can just move it to drcontainers and make it available to all clients.
A couple of changes should be made to the implementation to make it more friendly for general use:
- In the add function, when the
before
priority is notNULL
, the list should return an error if that priority is not found in the list - The resize function should remove invalid entries (i.e., not copy them to the new array) to minimize fragmentation for frequently modified callback lists
To avoid complications in the remove function, the list will need to allow direct index-based iteration, since existing usage by drmgr does not have a single key per entry (see drmgr_bb_cb_remove()
in drmgr.c
).