cfbolz changed the topic of #pypy to: #pypy PyPy, the flexible snake | IRC logs: and | the pypy angle is to shrug and copy the implementation of CPython as closely as possible, and staying out of design decisions
arigato has quit [Quit: ZNC -]
arigo_ has joined #pypy
fish1 has quit [Server closed connection]
fish1 has joined #pypy
jcea has quit [Ping timeout: 240 seconds]
nimaje has quit [Server closed connection]
nimaje has joined #pypy
[Arfrever] has quit [Ping timeout: 272 seconds]
[Arfrever] has joined #pypy
Dejan has joined #pypy
ruth2345345 has joined #pypy
<arigo_> fijal: (Py_ssize_t)refcount is really just refcount, which is a signed number already I think
<arigo_> the only risk I see is that a compiler will replace "if (refcount >= 0) refcount++;" with "refcount += (refcount >= 0);", which would defeat the original purpose, which is to not write to refcount at all if it is < 0
<arigo_> but I'm not sure it's a valid C change
<arigo_> it seems not, but you never know, of course
<arigo_> so no risk
<nimaje> hm, I don't think the C standard considers writing the same value to non-volatile variables a side effect, so that replacement would be ok, as it is '+= 0' for the case when no writing takes place in the original, but I would have to look that up to be sure
<arigo_> stackoverflow says no, the C compiler is not allowed to write if the source code doesn't contain the write, for two reasons: 1. it could trigger a segfault if the memory is read-only; 2. in multithreaded programs it's wrong because it adds a data race
<arigo_> in this case, we don't want a write so that the page is not marked as dirty, which is almost the same as reason 1.
<arigo_> you could write a C extension module with static global Python objects in read-only memory, and that would work in 3.12
arigo_ is now known as arigato
arigato is now known as arigo_
<cfbolz> arigo_: which I think is one of the motivations for the whole immortal object idea, isn't it?
jcea has joined #pypy
ruth2345345 has quit [Ping timeout: 255 seconds]
jcea has quit [Remote host closed the connection]
<arigo_> yes
Julian has joined #pypy
ruth2345345 has joined #pypy
Julian has quit [Ping timeout: 240 seconds]
Julian has joined #pypy
jcea has joined #pypy
Julian has quit [Ping timeout: 240 seconds]
Julian has joined #pypy