-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added documentation for Result Location Semantics #5035
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c88e218
Added documentation for RLS
i-am-linja fc48c23
cli: add `c++` subcommand to --help menu
andrewrk 5974a88
Update emit_raw.zig
markfirmware 022a71c
Shift error message now says "fixed-width integer type" instead of ju…
foobles 1e23a3c
Added gdi32.zig and More user32 definitions
JakubSzark f192807
Added documentation for RLS
i-am-linja a9e2cfc
Clarified meaning of "allocations"
i-am-linja 5835daa
Sorry, commit weirdness
i-am-linja 14379e5
Final edit
i-am-linja 313f4b7
Fix build error
d6fc82f
Ok this is the last one I swear
349087b
SERIOUSLY WE NEED TO DOCUMENT DOCGEN
1b859bc
OK I THINK IT'S ALL FINISHED
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
usingnamespace @import("bits.zig"); | ||
|
||
pub const PIXELFORMATDESCRIPTOR = extern struct { | ||
nSize: WORD = @sizeOf(PIXELFORMATDESCRIPTOR), | ||
nVersion: WORD, | ||
dwFlags: DWORD, | ||
iPixelType: BYTE, | ||
cColorBits: BYTE, | ||
cRedBits: BYTE, | ||
cRedShift: BYTE, | ||
cGreenBits: BYTE, | ||
cGreenShift: BYTE, | ||
cBlueBits: BYTE, | ||
cBlueShift: BYTE, | ||
cAlphaBits: BYTE, | ||
cAlphaShift: BYTE, | ||
cAccumBits: BYTE, | ||
cAccumRedBits: BYTE, | ||
cAccumGreenBits: BYTE, | ||
cAccumBlueBits: BYTE, | ||
cAccumAlphaBits: BYTE, | ||
cDepthBits: BYTE, | ||
cStencilBits: BYTE, | ||
cAuxBuffers: BYTE, | ||
iLayerType: BYTE, | ||
bReserved: BYTE, | ||
dwLayerMask: DWORD, | ||
dwVisibleMask: DWORD, | ||
dwDamageMask: DWORD, | ||
}; | ||
|
||
pub extern "gdi32" fn SetPixelFormat( | ||
hdc: ?HDC, | ||
format: i32, | ||
ppfd: ?*const PIXELFORMATDESCRIPTOR, | ||
) callconv(.Stdcall) bool; | ||
|
||
pub extern "gdi32" fn ChoosePixelFormat( | ||
hdc: ?HDC, | ||
ppfd: ?*const PIXELFORMATDESCRIPTOR, | ||
) callconv(.Stdcall) i32; | ||
|
||
pub extern "gdi32" fn SwapBuffers(hdc: ?HDC) callconv(.Stdcall) bool; | ||
pub extern "gdi32" fn wglCreateContext(hdc: ?HDC) callconv(.Stdcall) ?HGLRC; | ||
pub extern "gdi32" fn wglMakeCurrent(hdc: ?HDC, hglrc: ?HGLRC) callconv(.Stdcall) bool; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Allocation" is usually considered dynamic allocation, but that's not what's happening here.
Here we're talking about more general allocation of registers or stack space for variables.
For
field2
below, not even that - the allocation of space was already done byvar y
so we're just referring to that space instead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, what would the appropriate term for that be then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. I guess you could just clarify it; that the term refers to allocation of variables, which is either on the stack or in a register, rather than a dynamic allocation. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about just qualify the allocation as a stack allocation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it may not (and probably won't) always be a stack allocation, and you might care---Zig being a systems language---about that fact.
OTOH, you could argue that putting it in a register is an optimization, and that it's easier to think about if you just talk about the stack -- even though it's an optimization that always happens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, then 'non-heap' allocation, if you want to factor in compiler optimization potentials.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, cleared up and rebased. Now it should be ready for merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also subscribed to #2761 and #2765 so I can fix those points when it's relevant (haven't yet gotten the hang of inline testing).