Hey:

On Tue, Feb 3, 2015 at 12:37 AM, François Laupretre
<franc...@tekwire.net> wrote:
>> De : Xinchen Hui [mailto:larue...@php.net]
>> furthermore, I'd like to discuss remove the handle in zend_resource struct..
>>
>> it may breaks some usage (use resource as long/double/string)
>>
>>    case IS_RESOURCE: {
>>             char buf[sizeof("Resource id #") + MAX_LENGTH_OF_LONG];
>>             int len;
>>
>>             len = snprintf(buf, sizeof(buf), "Resource id #"
>> ZEND_LONG_FMT, (zend_long)Z_RES_HANDLE_P(op));
>>             return zend_string_init(buf, len, 0);
>>         }
>
> I don't understand how you can delete the resource if you remove the handle 
> from the zend_resource struct. Or would you store the index elsewhere ?

if you use HashTable ,  yes, it's hard to get rid of it, but we can
hidden it from user land..

and actually,  we only use integer index of regular_list for zend_resource..

if we decide to remove handle, then it maybe easy to re-implement it
as a plain c array like zend_resource[];

and when doing realloce, we allocate new segment, and link them togther. etc

thanks
>
> Regards
>
> François
>



-- 
Xinchen Hui
@Laruence
http://www.laruence.com/

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

Reply via email to