Avoid relocations in struct PDF_PSOpName. Per Chromium's docs/native_relocations.md, sometimes it makes sense to restructure read-only data to avoid relocations. In this case, the results are as follows on Linux: .rodata: +384 .data.rel.ro: -672 .rela.dyn: -1008 So even disregarding the relocation data, which varies on platform, the amount of read-only data goes down as a result of this change. Change-Id: I7238a3014a1a710a195db245c8c9500333c43071 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/74835 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/page/cpdf_psengine.cpp b/core/fpdfapi/page/cpdf_psengine.cpp index 90cc27b..98fb60e 100644 --- a/core/fpdfapi/page/cpdf_psengine.cpp +++ b/core/fpdfapi/page/cpdf_psengine.cpp
@@ -19,7 +19,8 @@ namespace { struct PDF_PSOpName { - const char* name; + // Inline string data reduces size for small strings. + const char name[9]; PDF_PSOP op; };