RE: [PHP-DEV] [PATCH] Converting accesses to refcount and is_ref to macros

2007-07-14 Thread David
> +#define ZVAL_ADDREF(pz) ++(pz)->refcount; > +#define ZVAL_ADDREF_M(pz, count) (pz)->refcount += (count); > > "_M"? Doesn't seem to be self-descriptive.. It was supposed to stand for "multiple', but you're right that it's not very clear. > +#define ZVAL_ADDREF_NP(pz)

Re: [PHP-DEV] [PATCH] Converting accesses to refcount and is_ref to macros

2007-07-14 Thread Antony Dovgal
+#define ZVAL_ADDREF(pz)++(pz)->refcount; +#define ZVAL_ADDREF_M(pz, count) (pz)->refcount += (count); "_M"? Doesn't seem to be self-descriptive.. +#define ZVAL_ADDREF_NP(pz) ++(pz).refcount; "_NP" ? "not pointer" ? Most of the macros in the en

RE: [PHP-DEV] [PATCH] Converting accesses to refcount and is_ref to macros

2007-07-14 Thread David
Hi, Thanks for getting back to me quickly. > > Was there some particular reason to remove those ()'s around the > macros? > > (usually they're there for a reason :) The reason for doing this is that in GC code "++(pz)->refcount;" becomes "++(pz)->refcount; (pz)->color__gc = GC_BLACK;". Those are

Re: [PHP-DEV] [PATCH] Converting accesses to refcount and is_ref to macros

2007-07-14 Thread Stanislav Malyshev
Was there some particular reason to remove those ()'s around the macros? (usually they're there for a reason :) Also, extra ; is not needed and doesn't conform to the style of other PHP code. Macros usually don't need ; at the end. Also, these: +#define ZVAL_ADDREF(pz)

Re: [PHP-DEV] [PATCH] Converting accesses to refcount and is_ref to macros

2007-07-13 Thread Jani Taskinen
David Wang kirjoitti: This patch is a simple, albeit widespread change that converts access to zval.refcount, zval.is_ref, _object_store.refcount to macros. There is no functional change to the code, but this will make it easier to implement a garbage collector in the future. Was there some par

[PHP-DEV] [PATCH] Converting accesses to refcount and is_ref to macros

2007-07-13 Thread David Wang
This patch is a simple, albeit widespread change that converts access to zval.refcount, zval.is_ref, _object_store.refcount to macros. There is no functional change to the code, but this will make it easier to implement a garbage collector in the future. This patch was too large to attach to the