mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This patch reduces about 73 kB memory. The original SparseBitSet could contain full 32bit integers, but all of that is not necessary for Unicode code points. By reducing the supported range to up to Unicode maximum, U+10FFFF, we can save extra memory. SparseBitSet holds 256-bit sliced pages and indices of them. Previously, we needed to hold up to 2^24-1 pages for keeping 32-bit integers. This CL limits the number of pages to 2^16-1 (65535), so that SparseBitSet only supports 24-bit integers now, but this is sufficient for keeping all Unicode code points. With this change, we can change the index integer type from uint32_t to uint16_t. Bug: 37357593 Test: minikin_tests passes Change-Id: I462cc27927752c942ac5da0bf303a5afb81b87a3