diff options
| author | Ben Gamari <ben@smart-cactus.org> | 2022-08-18 20:03:15 -0400 |
|---|---|---|
| committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-10-11 23:45:10 -0400 |
| commit | 6b0d2022699d3d8b446d024ee837c0d07e2c1aa0 (patch) | |
| tree | 3981c27bcbfd7ac99eb5c0b46cea5090d8a27ec9 /testsuite/tests/rts/ipe/ipe_lib.h | |
| parent | 866c736ef29a07c6f3aa68063ef98ee0ecea12f3 (diff) | |
| download | haskell-6b0d2022699d3d8b446d024ee837c0d07e2c1aa0.tar.gz | |
Refactor IPE initialization
Here we refactor the representation of info table provenance information
in object code to significantly reduce its size and link-time impact.
Specifically, we deduplicate strings and represent them as 32-bit
offsets into a common string table.
In addition, we rework the registration logic to eliminate allocation
from the registration path, which is run from a static initializer where
things like allocation are technically undefined behavior (although it
did previously seem to work). For similar reasons we eliminate lock
usage from registration path, instead relying on atomic CAS.
Closes #22077.
Diffstat (limited to 'testsuite/tests/rts/ipe/ipe_lib.h')
| -rw-r--r-- | testsuite/tests/rts/ipe/ipe_lib.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/rts/ipe/ipe_lib.h b/testsuite/tests/rts/ipe/ipe_lib.h new file mode 100644 index 0000000000..8aaa1c361e --- /dev/null +++ b/testsuite/tests/rts/ipe/ipe_lib.h @@ -0,0 +1,17 @@ +#pragma once + +#include "Rts.h" + +typedef struct { + char *buffer; + size_t n; + size_t size; +} StringTable; + +void init_string_table(StringTable *st); +uint32_t add_string(StringTable *st, const char *s); + +IpeBufferListNode *makeAnyProvEntries(Capability *cap, int start, int end); +IpeBufferEntry makeAnyProvEntry(Capability *cap, StringTable *st, HaskellObj closure, int i); +void dumpIPEToEventLog(void); + |
