xf86drm: rework drmGetDevices()
Do a once off memory allocation for each drmDevice. This allows us to ease the error handling and simplify the de-duplication loop. As part of this we need to rework drmFreeDevice() such so that it frees the relevant hunks, rather than leaving that to the caller. Some memory stats from the drmdevice test before: 22 allocs, 22 frees, 66,922 bytes allocated after: 9 allocs, 9 frees, 66,436 bytes allocated Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Acked-by: Alex Deucher <alexander.deucher@amd.com>
Loading
Please register or sign in to comment