mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 11:58:55 +00:00

XPTInterfaceDescriptor::num_additional_types can easily fit in 8 bits -- in practice it doesn't exceed 20, and there's already a check in DoTypeDescriptor that it doesn't exceed 255. This patch shrinks it and moves that check into XPT_InterfaceDescriptorAddTypes() so that any overflow would be detected more reliably. On 64-bit platforms this reduces sizeof(XPTInterfaceDescriptor) from 40 to 32 and correspondingly reduces "xpti-working-set" by 16 KiB. The patch also changes XPT_InterfaceDescriptorAddTypes() into a local function, because it's defined and only used in xpt_struct.cpp. --HG-- extra : rebase_source : 754a343bd52c3db35b21a4055a94c7235a70a7a2