<justin_smith>
andrewrk: right, it's a nullable pointer
<justin_smith>
I'm following the design of the async stack for a lockfree variant, it uses a null pointer for the bottom of the stack
<justin_smith>
the same test that atomic stack uses passes, except once every N runs a failed op near bottom of stack is mistaken for a success and then there's an NPE
xd1le has quit [Remote host closed the connection]
_whitelogger has joined #zig
ur5us_ has quit [Ping timeout: 260 seconds]
ur5us_ has joined #zig
rzezeski has joined #zig
GrooveStomp has quit [Remote host closed the connection]
earnestly has quit [Ping timeout: 256 seconds]
cole-h has quit [Quit: Goodbye]
cole-h has joined #zig
<andrewrk>
justin_smith, so the return type of the cmpxchg will be ??T and the outer layer represents the cmpxchg value and then the value underneath will still be optional
mokafolio has quit [Quit: Bye Bye!]
mokafolio has joined #zig
mokafolio has quit [Client Quit]
mokafolio has joined #zig
mokafolio has quit [Client Quit]
mokafolio has joined #zig
mokafolio has quit [Client Quit]
mokafolio has joined #zig
mokafolio has quit [Client Quit]
mokafolio has joined #zig
agentultra has quit [Ping timeout: 240 seconds]
a_chou has quit [Ping timeout: 246 seconds]
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
<justin_smith>
that seems strange, but OK
frett27_ has joined #zig
_whitelogger has joined #zig
mmohammadi9812 has joined #zig
waleee-cl has quit [Quit: Connection closed for inactivity]
<andrewrk>
it's the same concept as a double pointer: **T
<justin_smith>
with a double pointer there's a difference between a single deref and a double deref, but unless I'm very confused, there's no way to tell if a null from @cmpxchgWeak is a success (null on success) or a failure (returns actual value on failure, in this case it can be null)
ur5us_ has quit [Ping timeout: 260 seconds]
mattmurr has quit [Quit: ZNC 1.7.2+deb3 - https://znc.in]
marnix has quit [Ping timeout: 264 seconds]
marnix has joined #zig
<andrewrk>
have you tried it?
<andrewrk>
if (@cmpxchgWeak(...)) |optional_ptr| { // it didn't work } else { // it did work}
frett27_ has quit [Ping timeout: 240 seconds]
marnix has quit [Read error: Connection reset by peer]
cole-h has quit [Quit: Goodbye]
leonardoce has joined #zig
decentpenguin has quit [Read error: Connection reset by peer]
decentpenguin has joined #zig
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
knebulae has quit [Read error: Connection reset by peer]
mmohammadi9812 has quit [Quit: I quit (╯°□°)╯︵ ┻━┻]
jjsullivan1 has joined #zig
jjsullivan has quit [Ping timeout: 260 seconds]
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
earnestly has joined #zig
knebulae has joined #zig
FireFox317 has joined #zig
FireFox317 has quit [Client Quit]
<haliucinas>
0
haliucinas has quit [Quit: leaving]
haliucinas has joined #zig
<ikskuh>
1
<jjsullivan1>
three
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
<ifreund>
0b100
<justin_smith>
andrewrk: yeah, that's effectively what my code was doing, and I think I had the wrong explanation for my once-in-thousands-of-executions bug. I still don't have the test in a state where it fails every time.
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
ky0ko has quit [Quit: killed]
ky0ko has joined #zig
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
xackus_ has joined #zig
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
waleee-cl has joined #zig
leeward has joined #zig
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
omglasers2 has joined #zig
leonardoce has quit [Remote host closed the connection]
leonardoce has joined #zig
mokafolio has quit [Quit: Bye Bye!]
mokafolio has joined #zig
a_chou has joined #zig
leonardoce has quit [Ping timeout: 260 seconds]
frett27_ has joined #zig
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
frett27_ has quit [Ping timeout: 260 seconds]
marnix has joined #zig
Akuli has joined #zig
joey152 has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
frett27_ has joined #zig
LanceThePants has quit [Read error: Connection reset by peer]
LanceThePants has joined #zig
LanceThePants has quit [Read error: Connection reset by peer]
LanceThePants has joined #zig
cole-h has joined #zig
a_chou has quit [Quit: a_chou]
layneson has joined #zig
mokafolio has quit [Quit: Bye Bye!]
mokafolio has joined #zig
mokafolio has quit [Client Quit]
mokafolio has joined #zig
riba has joined #zig
marnix has quit [Read error: Connection reset by peer]
frmdstryr has joined #zig
marnix has joined #zig
<frmdstryr>
How can I set define enum fields based on a comptime value?
<ifreund>
it's a lot cleaner, and the implementation detail of the wrapper struct with a single opaque pointer field doen't leak into the listener callbacks
<tdeo>
this isn't related to the feature, but are you planning to use wl_proxy_add_dispatcher instead of wl_proxy_add_listener?
<tdeo>
i'd model events as a tagged union
<ifreund>
Haven't decided yet, I need to look at the details
<ifreund>
just went with what I'm familiar with for now
<tdeo>
makes sense
ur5us_ has joined #zig
<ifreund>
yeah, add_dispatcher looks promising, I think I'll have to try it out