Closed Bug 957175 Opened 10 years ago Closed 10 years ago

Reduce the number of relocations needed for NamesOfInterfacesWithProtos

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: bzbarsky, Assigned: froydnj)

References

Details

Attachments

(1 file)

See discussion in bug 956806 comment 13 through bug 956806 comment 16.
Depends on: 956806
Might be best (smallest) to just generate a single string with all the names in it, and generate a separate table of offsets into that string.
Hooray for string tables.

This compiles fine with GCC, but I think at one point GCC used to complain
about \0 in string constants.  May have to take a different tack if B2G builds
complain, or if other compilers are pedantic as well.
Attachment #8373361 - Flags: review?(bzbarsky)
Comment on attachment 8373361 [details] [diff] [review]
reduce relocations required by NamesOfInterfacesWithProtos

>+        return "extern const char *%s(unsigned int aIndex);\n\n" % self.accessorName

I'd prefer we drop the trailing \n here and have the caller insert them as needed.  That lets the caller control its own spacing.  Yes, we're not very consistent about that sort of thing right now.  :(  Simply making the CGList in the caller use "\n\n" instead of "\n" as the list separator might be good here.

>+        return """
>+const char *%s(unsigned int aIndex)

Please drop the leading newline here?

r=me
Attachment #8373361 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/241a7157196c
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: