Techcable has quit [Remote host closed the connection]
Techcable has joined #hpy
Techcable_ has joined #hpy
Techcable has quit [Remote host closed the connection]
Techcable_ has quit [Remote host closed the connection]
Techcable has joined #hpy
GianlucaRizzo has joined #hpy
antocuni_ has joined #hpy
antocuni_ has quit [Client Quit]
dalley has joined #hpy
GianlucaRizzo has quit [Remote host closed the connection]
GianlucaRizzo has joined #hpy
GianlucaRizzo has quit [Ping timeout: 256 seconds]
GianlucaRizzo has joined #hpy
GianlucaRizzo has quit [Ping timeout: 256 seconds]
GianlucaRizzo has joined #hpy
GianlucaRizzo has quit [Ping timeout: 250 seconds]
<antocuni> FWIW, I started a branch to implement HPyField on pypy
<antocuni> arigato, cfbolz: what are the performance of custom GC tracers in pypy?
<cfbolz> "not too bad, probably"
<cfbolz> we use them for jit frames for example
<antocuni> for HPy, some objects will need a custom tracer (if they have HPyFields). I am wondering whether I can register a custom tracer for all HPy objects (which would do nothing in most cases) or I should create two different W_ types, one with and one without a custom tracer
<cfbolz> ah, then the latter I think. but I am not sure you can have custom tracers for instances that way
<antocuni> currently we have W_HPyObject; I could create a subclass W_HPyObjectWithGc and register the custom tracer only for that
<antocuni> and it's easy to decide which class to instantiate, because there is a flag on the type
<antocuni> at least, I *think* it should work but I'm not sure
<cfbolz> ok, just saying that you cannot have custom trace hooks on instances at this point
<cfbolz> only for lltypes
<antocuni> yes, this is what I expected
<cfbolz> also custom instances have a fixed size always, I suppose you need a variable amount of space?
<antocuni> why variable?
<cfbolz> antocuni: doesn't it depend on the class definition in hpy how many fields an instances has?
<cfbolz> or is the memory managed from C and the problem is "simply" to find the GC pointers there
<antocuni> an C type declared in HPy defines how many bytes an instance needs. The memory is allocated by lltype.malloc
<antocuni> and all HPy instances (of any HPy type) are an instance of W_HPyObject (which has an hpy_data pointing to the memory)
<cfbolz> so it is variable ;-)
<cfbolz> ok
<cfbolz> I suppose in CPython you don't need this indirection
<antocuni> yes, in CPython it's just a PyObject*
<cfbolz> to get the same effect in pypy you would need a variable-sized W_HPyObject
<cfbolz> but we don't support that atm
<antocuni> yes, together with arigato we already discussed it, and I summarized here: https://foss.heptapod.net/pypy/pypy/-/issues/3542
<antocuni> I even tried to trick him into implementing the feature, but I didn't manage :)
<cfbolz> antocuni: ah, interesting
<cfbolz> Not impossible to implement
<cfbolz> I randomly read some code today that would be a problem, left a comment
<cfbolz> antocuni: another problem would be that you would like efficient support for all this in the JIT, I assume
GianlucaRizzo has joined #hpy
GianlucaRizzo has quit [Ping timeout: 246 seconds]