Repository navigation
s1/emit: allocate each enum case at its own size (vic-e0ni) - #20
Merged
Merged
Conversation
… case The emitted header includes stddef.h, and a constructor call allocates offsetof(struct E_T, u) + sizeof(((struct E_T*)0)->u.C_Case): the tag and the union up to the case's member, then the member. A call always has fields (a nullary case takes no ()), so the member exists. Before, every case took sizeof(struct E_T), the size of the largest case: a 2-3-4 tree B2 node took the size of a B4. Peak memory, C -O1: Datalog reach chain 100k 643 MB -> 451 MB (below the IMap version, 484 MB); tests/s2/bmap 333 MB -> 219 MB. bootstrap/seed.c regenerated. tests/run.sh: 185 ok, 0 FAIL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bead vic-e0ni: a constructor now allocates only its own case's size, not the largest case of the enum.
The emitted C includes
stddef.h. A constructor allocatesoffsetof(struct E_T, u) + sizeof(((struct E_T*)0)->u.C_Case): the tag and the union up to that case's member, then the member. A constructor call always has fields (a nullary case takes no()), so the member exists.Peak memory, C -O1:
bootstrap/seed.c is regenerated. Local tests/run.sh: 185 ok, 0 FAIL (the fixpoint and seed checks included).