optimized DeviceInfo class and ensureSizeIsEnough