Re: [PHP-DEV] persistent memory management

2006-12-05 Thread Alexey Zakhlestin
I believe, I sorted out most of the issues. Now, the last problem: what is the official way to deep-copy non-persistent zval into persistent zval? I expected zval_copy_ctor to have a flag. Unfortunately, it doesn't have one. the way I see it: void zval_copy_ctor(zval *value, zend_bool

Re: [PHP-DEV] persistent memory management

2006-12-03 Thread Alexey Zakhlestin
On 12/3/06, Andrey Hristov [EMAIL PROTECTED] wrote: Tried running the web server under memory checker like valgrind? Valgrind is linux only.. But I guess I still have one linux box.. I will give it a try. Maybe instead of peamlloc() just do malloc() well.. I can do that for clarity, but

Re: [PHP-DEV] persistent memory management

2006-12-03 Thread Matt Wilmas
Hi Alexey, Not sure what the exact problem is, or if this is related, but in your loc_set() function's zend_hash_add() calls, you have sizeof(HashTable) and sizeof(zval). Shouldn't both of those be sizeof(HashTable *) ? :-) Matt - Original Message - From: Alexey Zakhlestin Sent:

Re: [PHP-DEV] persistent memory management

2006-12-03 Thread Antony Dovgal
On 12/02/2006 11:07 PM, Alexey Zakhlestin wrote: Hi. I am trying to make my first php extension :) I am sorry, if the question would be too newbiesh, but I just couldn't find a more correct place to ask No need to use _exists here, zend_hash_find() returns FAILURE if it's failed to find

Re: [PHP-DEV] persistent memory management

2006-12-03 Thread Alexey Zakhlestin
On 12/3/06, Matt Wilmas [EMAIL PROTECTED] wrote: Hi Alexey, Not sure what the exact problem is, or if this is related, but in your loc_set() function's zend_hash_add() calls, you have sizeof(HashTable) and sizeof(zval). Shouldn't both of those be sizeof(HashTable *) ? :-) (HashTable *) and

Re: [PHP-DEV] persistent memory management

2006-12-03 Thread Alexey Zakhlestin
thanks. fixed it in subversion On 12/3/06, Antony Dovgal [EMAIL PROTECTED] wrote: No need to use _exists here, zend_hash_find() returns FAILURE if it's failed to find the value. You're doing the hash lookup twice here: if (!zend_hash_exists(ht, ns_name, ns_len + 1)) {

Re: [PHP-DEV] persistent memory management

2006-12-03 Thread Matt Wilmas
Hi Alexey, - Original Message - From: Alexey Zakhlestin Sent: Sunday, December 03, 2006 On 12/3/06, Matt Wilmas [EMAIL PROTECTED] wrote: Hi Alexey, Not sure what the exact problem is, or if this is related, but in your loc_set() function's zend_hash_add() calls, you have

Re: [PHP-DEV] persistent memory management

2006-12-03 Thread Alexey Zakhlestin
first zend_hash_add adds ns_ht, so it is (HashTable *) second zend_hash_add adds p_val, so it is (zval *) am I missing something obvious? On 12/3/06, Matt Wilmas [EMAIL PROTECTED] wrote: Hi Alexey, - Original Message - From: Alexey Zakhlestin Sent: Sunday, December 03, 2006 On

Re: [PHP-DEV] persistent memory management

2006-12-03 Thread Matt Wilmas
Hi Alexey, Whoops! Ugh, I was looking at the first param of zend_hash_add(). :-O You're correct then, sorry! :-/ Matt - Original Message - From: Alexey Zakhlestin Sent: Sunday, December 03, 2006 first zend_hash_add adds ns_ht, so it is (HashTable *) second zend_hash_add adds p_val,

Re: [PHP-DEV] persistent memory management

2006-12-03 Thread Alexey Zakhlestin
Here is valgrind output. It definitely shows that there is a problem, but I still can't guess where it is. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ==25913== Invalid read of size 4 ==25913==at 0x82AC068: zend_hash_exists (in /usr/bin/php5) ==25913==by 0x404EE42: zif_loc_isset

Re: [PHP-DEV] persistent memory management

2006-12-03 Thread Alexey Zakhlestin
And here is the command I used: valgrind `which php` -n tests/3.php -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] persistent memory management

2006-12-03 Thread Antony Dovgal
On 12/03/2006 09:29 PM, Alexey Zakhlestin wrote: Here is valgrind output. It definitely shows that there is a problem, but I still can't guess where it is. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ==25913== Invalid read of size 4 ==25913==at 0x82AC068: zend_hash_exists (in

Re: [PHP-DEV] persistent memory management

2006-12-03 Thread Alexey Zakhlestin
I know. but it will be very problematic to build debug-version of php there. and that is the only linux machine around. :-( On 12/3/06, Antony Dovgal [EMAIL PROTECTED] wrote: On 12/03/2006 09:29 PM, Alexey Zakhlestin wrote: Here is valgrind output. It definitely shows that there is a problem,

[PHP-DEV] persistent memory management

2006-12-02 Thread Alexey Zakhlestin
Hi. I am trying to make my first php extension :) I am sorry, if the question would be too newbiesh, but I just couldn't find a more correct place to ask here is the code: http://loccache.googlecode.com/svn/trunk/loccache.c I am trying to do the following: at the minit-phase I am allocating

[PHP-DEV] persistent memory management

2006-12-02 Thread Alexey Zakhlestin
Hi. I am trying to make my first php extension :) I am sorry, if the question would be too newbiesh, but I just couldn't find a more correct place to ask here is the code: http://loccache.googlecode.com/svn/trunk/loccache.c I am trying to do the following: at the minit-phase I am allocating a