Skip to content

Store a direct pointer to elts in FcPattern

小田喜陽彦 requested to merge akihiko.odaki/fontconfig:main into main

Pattern elts are either allocated in a contiguous region whose head is a FcPattern, or allocated separately. A reference to pattern elts is held as an offset to the associated FcPattern. When pattern elts are allocated separately, LeakSanitizer cannot understand this reference because it's not a normal pointer, and reports false leaks. Such false reports are very noisy when applying LeakSanitizer to an application that uses Fontconfig.

Store a direct pointer to elts instead of its relative offset in FcPattern so that developers can apply LeakSanitizer to their applications without being bothered by false reports. There are actually more places that operate on direct pointers of elts instead of relative offsets so this change also simplifies the code.

Merge request reports