Re: Re: Zend Engine.
| From: | Wez Furlong | Date: | Sat, 09 Jul 2005 02:26:21 +0000 |
| Subject: | Re: Re: Zend Engine. | ||
| References: | 1 2 3 4 5 6 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-2590@lists.php.net to get a copy of this message | ||
I've yet to see sample code and a succint question about it.
The things you've asked so far are really general and have been
covered elsewhere.
I suggest that you look at the (limited) zend api docs and also search
for conference slides from internals talks that have been given over
the years. If you're feeling dedicated, I suggest that you purchase
George Schlossnagle's book "Advanced PHP Programming".
We're happy to help, but only if you do some legwork yourself first.
--Wez.
On 7/8/05, herrwitten@php.net <herrwitten@php.net> wrote:
>
> On Jul 8, 2005, at 1:50 PM, Michael Wallner wrote:
>
> > herrwitten@php.net wrote:
> >
> >
> >> I have read through many modules and through Zend internals,
> >> but I can't figure out what I need to do.
> >>
> >
> > Did you read a book about C programming so far?
> > You must not free anything more than once.
> >
> > It's not a good idea to start writing a PHP extension
> > without learning some C basics (and probably more) --
> > I know that, because I made the same mistake like you
> > and tried to cook up some C code with minimal knowledge.
> >
> > Most of the time you'll want to use
> > zval_ptr_dtor(zval **) to "destroy" zvals, because
> > it takes care about the refcount and only frees the
> > "contents" of the zval if the refcount reaches 0.
> >
> > It's just (bad) luck when the memory at the address of
> > a freed location still contains the data you expect.
> >
> > I know it's very hard to get answers about php/ext coding,
> > so it is even more important to ask the questions in a
> > meaningful way. You'll also find many unanswered questions
> > of mine in the archive.
> >
> > The pecl/http repository contains thousands of "blood & sweat"
> > lines of code, perhaps you can find some answers there.
> >
> > Regards,
> > Mike
>
> Hey Mike,
>
> Thanks for the response.
>
> For the record and my ego, I have been a C programmer for a long
> time, and I have done extensive work in C++.
>
> My email with the multiple frees was an illustration of my
> frustration with the inconsistencies I had experienced. I am sorry
> that everyone is so caught up on that one email, because I asked a
> lot of direct questions in other emails.
>
> The Zend engine is really powerful, but it is sloppy, and I am having
> trouble figuring out the logic of it.
>
> --
> PECL development discussion Mailing List (http://pecl.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>