Refactor AllocKind definition

RESOLVED FIXED in Firefox 58

Status

()

enhancement
P3
normal
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: jonco, Assigned: jonco)

Tracking

unspecified
mozilla58
Points:
---

Firefox Tracking Flags

(firefox58 fixed)

Details

Attachments

(2 attachments)

Assignee

Description

2 years ago
No description provided.
Assignee

Comment 1

2 years ago
Some cleanup I noticed during the previous refactoring.

We can generate the AllocKind enum from the FOR_EACH_*_ALLOCKIND macros, although I did have to hardcode the first object alloc kind.  It's checked by a static assert so I think this is OK though.

I merged the background finalizable and nursery allocation flags into these macros too.
Attachment #8924247 - Flags: review?(sphink)
Assignee

Comment 2

2 years ago
Give AllocKind a uint8_t base and remove casting to size_t.  I check that this didn't change the size of the arena header.
Attachment #8924255 - Flags: review?(sphink)
Comment on attachment 8924247 [details] [diff] [review]
bug1413635-generate-alloc-kind

Review of attachment 8924247 [details] [diff] [review]:
-----------------------------------------------------------------

Oh good. I never did this because I was scared off by all the different files involved, and I wasn't sure what was visible from where, and just punted.
Attachment #8924247 - Flags: review?(sphink) → review+
Attachment #8924255 - Flags: review?(sphink) → review+
Assignee

Comment 4

2 years ago
(In reply to Jon Coppeard (:jonco) from comment #2)
> I check that this didn't change the size of the arena header.

Ah, this doesn't work on Windows.
Assignee

Comment 5

2 years ago
(In reply to Jon Coppeard (:jonco) from comment #4)
I'll land this without the change to Arena to use AllocKind rather than size_t for the allocKind member.

Comment 6

2 years ago
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ec967bb54314
Generate AllocKind enum automatically and include more information in the definition macro r=sfink
https://hg.mozilla.org/integration/mozilla-inbound/rev/1d72b8f7f10a
Give AllocKind enum a uint8_t base r=sfink
https://hg.mozilla.org/mozilla-central/rev/ec967bb54314
https://hg.mozilla.org/mozilla-central/rev/1d72b8f7f10a
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.