At 07:46 PM 7/18/2004 +0200, Bernd Römer wrote:
hi andi..

It seems you are using zend_dynamic_array() which is something I wrote a long time ago and never got to completely testing it. Seems to me that there's a problem there with the erealloc() call. It could relocate the data storage and, therefore, all of your pointers to that storage might end up being wrong.

I haven't seen the problem yet... it worked fine all the time... perhaps by accident :) I will take a look at it after dinner :)


Can you explain exactly what kind of data structure you require? I am planning on working on a static allocator (not stack) soon and I'm just wondering if that would suit your needs or not.

i need a simple dynamic array... with no additional features... normally i use my own dynamic-array functions.. but i wanted that extension as small as possible.. so i used zend_dynamic_array... it looked almost like my own "lib". (but) I miss some functions like destructor and registering a destructor-function for the entries (which i wouldn't use in this case)... and some functions to interact and manage the dynamic arrays (also not used in my case) like merging, sorting, traversing, comparing and so on...

Well the idea here was to keep it as fast and as simple as possible, that's why it doesn't have all those features you can find in zend_hash. You probably didn't see the problem because either you didn't reach erealloc() or it managed to do reallocation without moving the memory.
As as far as my knowledge goes (we might need to do some grepping) no one is using zend_dynamic_array, I don't mind if you come with an alternate suggestion. But it has to be very small and high-performance :)


Thanks,
Andi

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to