Closed
Bug 826779
Opened 12 years ago
Closed 12 years ago
Get DMD to build on Windows
Categories
(Core :: DMD, defect)
Tracking
()
RESOLVED
FIXED
mozilla20
People
(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)
References
Details
Attachments
(1 file)
3.43 KB,
patch
|
bbondy
:
review+
|
Details | Diff | Splinter Review |
I have a patch which makes Windows build successfully with --enable-dmd. I'd like to land it for now, but I haven't tested DMD yet. I'll do that work in bug 819839.
Assignee | ||
Comment 1•12 years ago
|
||
Comment 2•12 years ago
|
||
Comment on attachment 697994 [details] [diff] [review]
Patch (v1)
Review of attachment 697994 [details] [diff] [review]:
-----------------------------------------------------------------
::: memory/replace/dmd/DMD.cpp
@@ +49,5 @@
> + return si.dwPageSize;
> +}
> +static void* valloc(size_t size)
> +{
> + return VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE);
> To reserve and commit pages in one step, call VirtualAlloc
> with MEM_COMMIT | MEM_RESERVE.
>
> The function fails if you attempt to commit a page that has not been
> reserved. The resulting error code is ERROR_INVALID_ADDRESS.
This MSDN info doc is a bit confusing to me.
I think reserving only matters for rounding though if you have the first parameter non null. So what you have is fine as far as I can tell.
I wouldn't be opposed to passing in MEM_RESERVE | MEM_COMMIT
Attachment #697994 -
Flags: review?(netzen) → review+
![]() |
||
Comment 3•12 years ago
|
||
Comment on attachment 697994 [details] [diff] [review]
Patch (v1)
Review of attachment 697994 [details] [diff] [review]:
-----------------------------------------------------------------
::: memory/replace/dmd/DMD.cpp
@@ +47,5 @@
> + SYSTEM_INFO si;
> + GetSystemInfo(&si);
> + return si.dwPageSize;
> +}
> +static void* valloc(size_t size)
Why have you defined valloc()?
Assignee | ||
Comment 4•12 years ago
|
||
(In reply to Brian R. Bondy [:bbondy] from comment #2)
> Comment on attachment 697994 [details] [diff] [review]
> Patch (v1)
>
> Review of attachment 697994 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: memory/replace/dmd/DMD.cpp
> @@ +49,5 @@
> > + return si.dwPageSize;
> > +}
> > +static void* valloc(size_t size)
> > +{
> > + return VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE);
>
> > To reserve and commit pages in one step, call VirtualAlloc
> > with MEM_COMMIT | MEM_RESERVE.
> >
> > The function fails if you attempt to commit a page that has not been
> > reserved. The resulting error code is ERROR_INVALID_ADDRESS.
>
> This MSDN info doc is a bit confusing to me.
> I think reserving only matters for rounding though if you have the first
> parameter non null. So what you have is fine as far as I can tell.
>
> I wouldn't be opposed to passing in MEM_RESERVE | MEM_COMMIT
OK, I'll do that, but I don't think that makes any difference.
(In reply to Nicholas Nethercote [:njn] from comment #3)
> Comment on attachment 697994 [details] [diff] [review]
> Patch (v1)
>
> Review of attachment 697994 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: memory/replace/dmd/DMD.cpp
> @@ +47,5 @@
> > + SYSTEM_INFO si;
> > + GetSystemInfo(&si);
> > + return si.dwPageSize;
> > +}
> > +static void* valloc(size_t size)
>
> Why have you defined valloc()?
Because the Microsoft CRT does not support valloc, which is later on called in this file.
Assignee | ||
Comment 5•12 years ago
|
||
Comment 6•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
![]() |
||
Updated•12 years ago
|
Component: General → DMD
You need to log in
before you can comment on or make changes to this bug.
Description
•