Re: [PHP4BETA] quick API question re refcounts in c-modules.
| From: | Thies C. Arntzen | Date: | Thu, 09 Dec 1999 20:45:10 +0000 |
| Subject: | Re: [PHP4BETA] quick API question re refcounts in c-modules. | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-7738@lists.php.net to get a copy of this message | ||
On Thu, 9 Dec 1999, Zeev Suraski wrote:
> At 22:23 09/12/1999 , Thies C. Arntzen wrote:
> >this is by no way really important, but i'd like to understand how we want
> >to handle recursive refs like this ($this->parser is a resource keeping a
> >ref of $this).
>
> I haven't really read your entire letter, I just glanced through this, so
> there's a (small?) chance that I got it wrong. But as soon as I read the
> above sentence, the simple answer that came to mind is that you simply can't.
>
> The reference mechanism in PHP 4.0 wasn't designed for building fancy data
> structures such as recursive lists, and its behavior does prevent you from
> doing that sort of stuff (that is, it's not that it is unstable, it's just
> that its designed behavior doesn't fit the purposes of recursive data
> structures).
ok, 2nd try (to explain)
- a c-module receive a ref to a php-var.
- instead of "just-do-and-forget" this function want's to keep that ref
for some time (see docs for ocibindbyname) -> so the c-module does an
zval_add_ref() for that php-var.
- this ref to php-var is kept in a zend-resource (eg an oracle-cursor)
- when this resource (eg oracle-resource) gets destructed, it calles
zval_del_ref() for the remembered references to php-vars.
so far i hop you do agree... (i really do;-)
problem is now when i do this inside an object with a reference to the
object itself (my xml question from the 1st mail).
got me?
tc
> Zeev
> --
> Zeev Suraski <zeev@zend.com> http://www.zend.com/
>
>
Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!"
Digital Collections Phone +49 40 235350 Fax +49 40 23535180
Hammerbrookstr. 93 20097 Hamburg / Germany