Date: 12/15/00
- Next message: cardinal <email protected>: "[PHP-DEV] PHP 4.0 Bug #8289: print_r doesn't reset() arrays"
- Previous message: arvindkumar <email protected>: "[PHP-DEV] PHP 4.0 Bug #8288: Problem in Installation with Apache 1.3.14"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi
I sent this message to the list a few weeks ago, but didn't get any
response, so I'm giving it another shot.
Specificly, I need to know if the following is correct:
zval *a;
ALLOC_INIT_ZVAL(a);
array_init(a);
add_next_index_string(a, string, 1);
add_next_index_string(a, string2, 1);
// hmm
FREE_ZVAL(a);
or if it's leaking memory, and I need to do some magic before FREE_ZVAL
to free the copies of the strings and the array-metadata.
I'd be greatful if anyone cared to review my patch and see if there are
other bugs.
(http://www.stud.ntnu.no/~ragnarkj/download/php-stacktrace.patch)
Thanks.
----- Forwarded message from Ragnar Kjørstad <php <email protected>> -----
Date: Sun, 19 Nov 2000 00:58:36 +0100
From: Ragnar Kjørstad <php <email protected>>
To: Zeev Suraski <zeev <email protected>>
Cc: php-dev <email protected>
Subject: Re: [PHP-DEV] Stacktrace in errormessages
X-Mailer: Mutt 0.95.5i
In-Reply-To: <5.0.0.25.2.20001029183232.033fa1f8 <email protected>>; from Zeev Suraski on Sun, Oct 29, 2000 at 06:34:04PM +0200
On Sun, Oct 29, 2000 at 06:34:04PM +0200, Zeev Suraski wrote:
> >If no, could you give me some hints to where this stack should be
> >modified?
> >
> >I'll try to add the feature - even if you don't think it belongs in the
> >php distribution it will be a nice feature for us and possible others.
> >(Or if you choose, you can add it with a compile-option).
>
> Well, it'd have to be added to the execute() code.
OK, now it kind of works :-)
However, I still have a few problems:
* Memory managment - how to free data-structures
* will FREE_ZVAL() free the content too, if I free an array?
* does zend_stack_del_top() free the content properly? e.g. if it's
an object?
* How does the reference-counter system work?
* How do I create complex datastructures?
I found out how to build an array (I think :-) ), but not
how to put an array into an array and so on.
I'll be greatful for any pointers to documentation (I browsed zend.org
but could not find answers to theese questions) or answers to theese
specific questions.
Once I find out how to do this, I'm going to:
* add function arguments to the stack-trace
* modify the internal error-handler to print the stack-trace
* add an #ifdef or configuration-switch
> As I said, though, we
> don't want to add it because it'll significantly reduce function call
> performance.
OK, I'll just maintain it as a seperate patch then.
BTW: How do you benchmark this? Run a profiler on the cgi-version of php?
Run apachebench on a php-webpage? Any other ways?
Thanks
-- Ragnar Kjørstad Modus Media----- End forwarded message -----
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: cardinal <email protected>: "[PHP-DEV] PHP 4.0 Bug #8289: print_r doesn't reset() arrays"
- Previous message: arvindkumar <email protected>: "[PHP-DEV] PHP 4.0 Bug #8288: Problem in Installation with Apache 1.3.14"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

