From 47fb7f0115a3f9bc8198bd304e216ce392426580 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 23 Aug 2024 19:18:07 -0700 Subject: [PATCH] font: Collection can't use segmentedlist prealloc --- src/font/Collection.zig | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/font/Collection.zig b/src/font/Collection.zig index 1d6c3e2fe..18a236629 100644 --- a/src/font/Collection.zig +++ b/src/font/Collection.zig @@ -346,10 +346,11 @@ pub fn setSize(self: *Collection, size: DesiredSize) !void { /// small style count. /// /// We use a segmented list because the entry values must be pointer-stable -/// to support the "alias" field in Entry. SegmentedList also lets us do -/// a prealloc which is great for performance since most happy path cases -/// do not use many font fallbacks. -const StyleArray = std.EnumArray(Style, std.SegmentedList(Entry, 4)); +/// to support the "alias" field in Entry. +/// +/// WARNING: We cannot use any prealloc yet for the segmented list because +/// the collection is copied around by value and pointers aren't stable. +const StyleArray = std.EnumArray(Style, std.SegmentedList(Entry, 0)); /// Load options are used to configure all the details a Collection /// needs to load deferred faces.