Closed Bug 555435 Opened 16 years ago Closed 16 years ago

reduce memory overhead of preloading cmaps

Categories

(Core :: Layout: Text and Fonts, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jfkthame, Assigned: jfkthame)

Details

Attachments

(1 file)

We preload the font cmap table into a gfxSparseBitSet in each font entry, for use in font fallback. Because gfxSparseBitSet uses nsTArray<> to manage its collection of Blocks, it will typically over-allocate array capacity during construction as the array grows. However, as these arrays are never modified after the initial reading of the cmap, any residual over-allocation at that time represents permanently-wasted space. I checked on my Mac with a fairly modest collection of fonts installed (around 200 families), and the total over-capacity of the cmap block arrays was around 800K. For a user with a very large number of fonts, it would be correspondingly greater. We can reclaim this memory by simply calling Compact() on the block arrays after each cmap is loaded.
Assignee: nobody → jfkthame
Attachment #435370 - Flags: review?(jdaggett)
Attachment #435370 - Flags: review?(jdaggett) → review+
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: