summaryrefslogtreecommitdiff
path: root/processor/head.m4
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2014-11-09 06:49:44 +0000
committerXuefer <xuefer@gmail.com>2014-11-09 06:49:44 +0000
commit977ff39373429681d4bf43a1d7b61b64cd30993a (patch)
tree5125063fbbc6a51eeb29683c78b99daec4470595 /processor/head.m4
parenteefebd8773e8f29f5d00f6c03b0b10eb5661f34c (diff)
downloadxcache-977ff39373429681d4bf43a1d7b61b64cd30993a.tar.gz
xcache-977ff39373429681d4bf43a1d7b61b64cd30993a.zip
separate plain c code to .h files
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1555 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
Diffstat (limited to 'processor/head.m4')
-rw-r--r--processor/head.m472
1 files changed, 18 insertions, 54 deletions
diff --git a/processor/head.m4 b/processor/head.m4
index ad0b1d3..c727698 100644
--- a/processor/head.m4
+++ b/processor/head.m4
@@ -1,5 +1,11 @@
-dnl {{{ === program start ========================================
+dnl === program start ========================================
divert(0)
+ifdef(`XCACHE_ENABLE_TEST', `
+m4_errprint(`AUTOCHECK INFO: runtime autocheck Enabled (debug build)')
+', `
+m4_errprint(`AUTOCHECK INFO: runtime autocheck Disabled (optimized build)')
+')
+
#include <string.h>
#include <stdio.h>
@@ -25,11 +31,15 @@ EXPORT(`#include "xcache/xc_allocator.h"')
#if defined(HARDENING_PATCH_HASH_PROTECT) && HARDENING_PATCH_HASH_PROTECT
extern unsigned int zend_hash_canary;
#endif
-dnl }}}
+dnl
-include(__dir__`/debug-helper.m4')
-include(__dir__`/type-helper.m4')
-include(__dir__`/string-helper.m4')
+#ifdef DEBUG_SIZE
+static int xc_totalsize = 0;
+#endif
+
+#include "processor/debug.h"
+#include "processor/types.h"
+include(__dir__`/types.m4')
/* {{{ call op_array ctor handler */
extern zend_bool xc_have_op_array_ctor;
@@ -40,54 +50,8 @@ static void xc_zend_extension_op_array_ctor_handler(zend_extension *extension, z
}
}
/* }}} */
-/* {{{ memsetptr */
-IFAUTOCHECK(`dnl
-static void *memsetptr(void *mem, void *content, size_t n)
-{
- void **p = (void **) mem;
- void **end = (void **) ((char *) mem + n);
- while (p < end - sizeof(content)) {
- *p = content;
- p += sizeof(content);
- }
- if (p < end) {
- memset(p, -1, end - p);
- }
- return mem;
-}
-')
-/* }}} */
-dnl {{{ _xc_processor_t
-typedef struct _xc_processor_t {
- char *p;
- size_t size;
- HashTable zvalptrs;
- zend_bool handle_reference; /* enable if to deal with reference */
- zend_bool have_references;
- ptrdiff_t relocatediff;
-
- const xc_entry_php_t *entry_php_src;
- const xc_entry_php_t *entry_php_dst;
- const xc_entry_data_php_t *php_src;
- const xc_entry_data_php_t *php_dst;
- const zend_class_entry *cache_ce;
- zend_ulong cache_class_index;
-
- const zend_op_array *active_op_array_src;
- zend_op_array *active_op_array_dst;
- const zend_class_entry *active_class_entry_src;
- zend_class_entry *active_class_entry_dst;
- zend_uint active_class_index;
- zend_uint active_op_array_index;
- const xc_op_array_info_t *active_op_array_infos_src;
-
- zend_bool readonly_protection; /* wheather it's present */
-
- STRING_HELPER_T
-
- IFAUTOCHECK(xc_vector_t allocsizes;)
-} xc_processor_t;
-dnl }}}
-STRING_HELPERS()
+#include "processor/processor-t.h"
+#include "processor/string-helper.h"
+include(__dir__`/string-helper.m4')
include(__dir__`/class-helper.m4')