Closed Bug 1936728 Opened 2 months ago Closed 15 days ago

Including mozmemory_utils.h in some source files breaks builds

Categories

(Core :: Memory Allocator, task, P3)

task

Tracking

()

RESOLVED FIXED
136 Branch
Tracking Status
firefox136 --- fixed

People

(Reporter: pbone, Assigned: pbone)

Details

Attachments

(1 file, 1 obsolete file)

This file, mozmemory_utils.h, cannot be included easily since it can create strange build problems with windows headers, even with the right #ifdefs. It currently has only "stall on allocation failure" code, which we can move to a new header should we want to add more generic "utils" in the future.

This file includes some windows headers and including it in some .cpp files
creates build errors (despite #ifdef XP_WIN). So if we want to add more
"utils" first we should more everything related to stalling on a failed
allocation into a new header file.

That is actually surprising. It's "only" including wtypes.h, which shouldn't be that bad. What kind of errors are you seeing?

Flags: needinfo?(pbone)

I was including it in, I think the profiler, and windows builds failed because they couldn't find windows.h

Edit, it wasn't the profiler. I was including it in a bunch of places including DOMArena and js/public/Utilities.h which meant it got pulled in by lots of parts of the build. But I think it was the profiler that failed.

Flags: needinfo?(pbone)
Assignee: nobody → pbone
Status: NEW → ASSIGNED

Can you link to a log? That makes no sense to me.

Flags: needinfo?(pbone)

(In reply to Mike Hommey [:glandium] from comment #4)

Can you link to a log? That makes no sense to me.

Sure, https://treeherder.mozilla.org/jobs?repo=try&revision=49291af35dca641e2317ab582d2afe1c51547616&selectedTaskRun=c1fTkstlSw6vJ6TO28_7HQ.0 It was from a couple of weeks ago. The patches add more functions into mozmemory_utils.h and include it in more places.

Flags: needinfo?(pbone) → needinfo?(mh+mozilla)

Ok, so wtypes.h includes rpc.h which includes windows.h. Sadfaces all the way down. I think we should just remove the include. We can just use standard types rather than the windows equivalents.

Flags: needinfo?(mh+mozilla)
Summary: Rename mozmemory_utils.h → Including mozmemory_utils.h in some source files breaks builds
Attachment #9443132 - Attachment is obsolete: true
Attachment #9462104 - Attachment description: WIP: Bug 1936728 - Use standard data types for MozVirtualAlloc() → Bug 1936728 - Use standard data types for MozVirtualAlloc() r=glandium
Pushed by pbone@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c75c56938b0d Use standard data types for MozVirtualAlloc() r=glandium
Status: ASSIGNED → RESOLVED
Closed: 15 days ago
Resolution: --- → FIXED
Target Milestone: --- → 136 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: