
FYI, my second message on this issue didn't reach the list because of a stupid error of mine, so Guido and I exchanged two mails in private. His response to the msg below was that he thinks that tweaking the refcount scheme at this level wouldn't contribute much and that he doesn't intend to change anything on this until 2.0 which will be rewritten from scratch. Besides, if I want to satisfy my curiosity in hacking the refcounts I can do it with a small patch because I've already located the places where the ob_refcnt slot is accessed directly. ----- Forwarded message -----

Vladimir Marangozov wrote:
Well, one Euro on that issue:
I think if at all, this should be no typecast to stay safe. As long as every PyObject has a refcount, this would be correct and checked by the compiler. Why loose it? #define _Py_GETREF(op) ((op)->ob_refcnt) This carries the same semantics, the same compiler check, but adds a level of abstraction for future changes.
I wish to incref this wish by mine. In order to be able to try different memory allocation strategies, I would go even further and give every object type its own allocation macro which carries info about the object type about to be allocated. This costs nothing but a little macro expansion for the C compiler, but would allow to try new schemes, without always patching the Python source. ciao - chris -- Christian Tismer :^) <mailto:tismer@appliedbiometrics.com> Applied Biometrics GmbH : Have a break! Take a ride on Python's Kaiserin-Augusta-Allee 101 : *Starship* http://starship.python.net 10553 Berlin : PGP key -> http://wwwkeys.pgp.net PGP Fingerprint E182 71C7 1A9D 66E9 9D15 D3CC D4D7 93E2 1FAE F6DF we're tired of banana software - shipped green, ripens at home

Vladimir Marangozov wrote:
Well, one Euro on that issue:
I think if at all, this should be no typecast to stay safe. As long as every PyObject has a refcount, this would be correct and checked by the compiler. Why loose it? #define _Py_GETREF(op) ((op)->ob_refcnt) This carries the same semantics, the same compiler check, but adds a level of abstraction for future changes.
I wish to incref this wish by mine. In order to be able to try different memory allocation strategies, I would go even further and give every object type its own allocation macro which carries info about the object type about to be allocated. This costs nothing but a little macro expansion for the C compiler, but would allow to try new schemes, without always patching the Python source. ciao - chris -- Christian Tismer :^) <mailto:tismer@appliedbiometrics.com> Applied Biometrics GmbH : Have a break! Take a ride on Python's Kaiserin-Augusta-Allee 101 : *Starship* http://starship.python.net 10553 Berlin : PGP key -> http://wwwkeys.pgp.net PGP Fingerprint E182 71C7 1A9D 66E9 9D15 D3CC D4D7 93E2 1FAE F6DF we're tired of banana software - shipped green, ripens at home
participants (2)
-
Christian Tismer
-
Vladimir Marangozov