Permalink
Browse files

Ground code for [] on maps

  • Loading branch information...
1 parent 3466415 commit c1bccc3f0702b1e9f020b53e619f69c7fa85820e @colder committed Sep 6, 2011
Showing with 317 additions and 8 deletions.
  1. +6 −4 php_weakref.c
  2. +5 −0 php_weakref.h
  3. +306 −4 wr_weakmap.c
View
@@ -29,15 +29,17 @@
#include "wr_weakmap.h"
#include "php_weakref.h"
-void wr_store_init(TSRMLS_D) {
+void wr_store_init(TSRMLS_D) /* {{{ */
+{
wr_store *store = emalloc(sizeof(wr_store));
store->objs = emalloc(sizeof(wr_store_data));
store->size = 1;
WR_G(store) = store;
-}
+} /* }}} */
-void wr_store_destroy(TSRMLS_D) {
+void wr_store_destroy(TSRMLS_D) /* {{{ */
+{
wr_store *store = WR_G(store);
if (store->objs != NULL) {
@@ -47,7 +49,7 @@ void wr_store_destroy(TSRMLS_D) {
efree(store);
WR_G(store) = NULL;
-}
+} /* }}} */
void wr_store_dtor(void *object, zend_object_handle ref_handle TSRMLS_DC) /* {{{ */
{
View
@@ -52,6 +52,11 @@ typedef struct _wr_weakref_object {
typedef struct _wr_weakmap_object {
zend_object std;
+ zend_function *fptr_offset_get;
+ zend_function *fptr_offset_set;
+ zend_function *fptr_offset_has;
+ zend_function *fptr_offset_del;
+ zend_function *fptr_count;
} wr_weakmap_object;
typedef void (*wr_ref_dtor)(void *object, zend_object *wref_obj TSRMLS_DC);
Oops, something went wrong. Retry.

0 comments on commit c1bccc3

Please sign in to comment.