Index: /trunk/disassembler.c
===================================================================
--- /trunk/disassembler.c	(revision 503)
+++ /trunk/disassembler.c	(revision 504)
@@ -66,5 +66,5 @@
 			}
 		}
-		add_u_assoc_zval_ex(list, BUCKET_KEY_TYPE(b), buf, b->nKeyLength, zv);
+		add_u_assoc_zval_ex(list, BUCKET_KEY_TYPE(b), ZSTR(buf), b->nKeyLength, zv);
 	}
 	efree(buf);
Index: /trunk/processor/hashtable.m4
===================================================================
--- /trunk/processor/hashtable.m4	(revision 503)
+++ /trunk/processor/hashtable.m4	(revision 504)
@@ -60,5 +60,5 @@
 					}
 				}
-				add_u_assoc_zval_ex(dst, BUCKET_KEY_TYPE(b), buf, keysize, zv);
+				add_u_assoc_zval_ex(dst, BUCKET_KEY_TYPE(b), ZSTR(buf), keysize, zv);
 			}
 			')
Index: /trunk/processor/main.m4
===================================================================
--- /trunk/processor/main.m4	(revision 503)
+++ /trunk/processor/main.m4	(revision 504)
@@ -111,5 +111,5 @@
 		IFSTORE(`$1 = (zend_class_entry *) xc_get_class_num(processor, $2);')
 		IFRESTORE(`$1 = xc_get_class(processor, (zend_ulong) $2);')
-		IFDASM(`add_assoc_stringl_ex(dst, ZEND_STRS("$3"), $2->name, strlen($2->name), 1);')
+		IFDASM(`add_assoc_unicodel_ex(dst, ZEND_STRS("$3"), ZSTR_U($2->name), $2->name_length, 1);')
 	}
 	else {
Index: /trunk/processor/processor.m4
===================================================================
--- /trunk/processor/processor.m4	(revision 503)
+++ /trunk/processor/processor.m4	(revision 504)
@@ -57,7 +57,5 @@
 DEF_STRUCT_P_FUNC(`zend_brk_cont_element', , `
 #ifdef ZEND_ENGINE_2_2
-#ifndef IS_UNICODE
 	DISPATCH(int, start)
-#endif
 #endif
 	DISPATCH(int, cont)
@@ -283,5 +281,5 @@
 #endif
 	dnl isnt in php6 yet
-#if defined(ZEND_ENGINE_2_2) && !defined(IS_UNICODE)
+#if defined(ZEND_ENGINE_2_2)
 	PROC_CLASS_ENTRY_P(ce)
 #endif
Index: /trunk/processor/string.m4
===================================================================
--- /trunk/processor/string.m4	(revision 503)
+++ /trunk/processor/string.m4	(revision 504)
@@ -39,5 +39,5 @@
 
 				INIT_ZVAL(zv);
-				ZVAL_UNICODEL(&zv, (UChar *) ($2), $3 - 1, 1);
+				ZVAL_UNICODEL(&zv, ZSTR_U($2), $3 - 1, 1);
 				zend_make_printable_zval(&zv, &reszv, &usecopy);
 				fprintf(stderr, "string:%s:\t\"", "$1");
@@ -64,9 +64,14 @@
 		FIXPOINTER_EX(`PTRTYPE', DSTPTR)
 		IFDASM(`
-				ifelse(STRTYPE,zstr_uchar, `
-					add_assoc_unicodel_ex(dst, ZEND_STRS("$4"), $2, $3-1, 1);
-					', ` dnl else
-					add_assoc_stringl_ex(dst, ZEND_STRS("$4"), $2, $3-1, 1);')
+			ifelse(STRTYPE,zstr_uchar, `
+				add_assoc_unicodel_ex(dst, ZEND_STRS("$4"), ZSTR_U($2), $3-1, 1);
+				', ` dnl else
+				ifelse(STRTYPE,zstr_char, `
+					add_assoc_stringl_ex(dst, ZEND_STRS("$4"), ZSTR_S($2), $3-1, 1);
+					', `
+					add_assoc_stringl_ex(dst, ZEND_STRS("$4"), $2, $3-1, 1);
 				')
+			')
+		')
 	}
 	popdef(`DSTPTR')
Index: /trunk/utils.c
===================================================================
--- /trunk/utils.c	(revision 503)
+++ /trunk/utils.c	(revision 504)
@@ -584,13 +584,4 @@
 #endif
 
-void xc_zend_class_add_ref(zend_class_entry ZESW(*ce, **ce))
-{
-#ifdef ZEND_ENGINE_2
-	(*ce)->refcount++;
-#else
-	(*ce->refcount)++;
-#endif
-}
-
 xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, char *filename TSRMLS_DC) /* {{{ */
 {
@@ -635,5 +626,5 @@
 	{
 		zend_function tmp_func;
-		zend_hash_copy(&TG(function_table), &XG(internal_function_table), (copy_ctor_func_t) function_add_ref, (void *) &tmp_func, sizeof(tmp_func));
+		zend_hash_copy(&TG(function_table), &XG(internal_function_table), NULL, (void *) &tmp_func, sizeof(tmp_func));
 	}
 	TG(internal_function_tail) = TG(function_table).pListTail;
@@ -644,5 +635,5 @@
 	{
 		xc_cest_t tmp_cest;
-		zend_hash_copy(&TG(class_table), &XG(internal_class_table), (copy_ctor_func_t) xc_zend_class_add_ref, (void *) &tmp_cest, sizeof(tmp_cest));
+		zend_hash_copy(&TG(class_table), &XG(internal_class_table), NULL, (void *) &tmp_cest, sizeof(tmp_cest));
 	}
 #endif
Index: /trunk/xcache.c
===================================================================
--- /trunk/xcache.c	(revision 503)
+++ /trunk/xcache.c	(revision 504)
@@ -1720,9 +1720,9 @@
 		zend_hash_destroy(&XG(internal_class_table));
 
-		zend_hash_init_ex(&XG(internal_function_table), 100, NULL, CG(function_table)->pDestructor, 1, 0);
-		zend_hash_init_ex(&XG(internal_class_table),    10,  NULL, CG(class_table)->pDestructor,    1, 0);
-
-		zend_hash_copy(&XG(internal_function_table), CG(function_table), (copy_ctor_func_t) function_add_ref, &tmp_func, sizeof(tmp_func));
-		zend_hash_copy(&XG(internal_class_table), CG(class_table), (copy_ctor_func_t) xc_zend_class_add_ref, &tmp_cest, sizeof(tmp_cest));
+		zend_hash_init_ex(&XG(internal_function_table), 100, NULL, NULL, 1, 0);
+		zend_hash_init_ex(&XG(internal_class_table),    10,  NULL, NULL, 1, 0);
+
+		zend_hash_copy(&XG(internal_function_table), CG(function_table), NULL, &tmp_func, sizeof(tmp_func));
+		zend_hash_copy(&XG(internal_class_table), CG(class_table), NULL, &tmp_cest, sizeof(tmp_cest));
 
 		XG(internal_table_copied) = 1;
