xf86drm: Allocate drmDevicePtr's on stack
Currently we dynamically allocate 16 pointers and reallocate more as needed. Instead, allocate the maximum number (256) on stack - the number is small enough and is unlikely to change in the foreseeable future. This allows us to simplify the error handling and even shed a few bytes off the final binary. v2: - add a define & description behind the magic 256 - report error to strerr and skip when over 256 device nodes Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Tested-by: Robert Foss <robert.foss@collabora.com> (v1) Reviewed-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Eric Engestrom <eric@engestrom.ch> (v1)
Loading
Please register or sign in to comment