summaryrefslogtreecommitdiff
path: root/src/sp_utils.h
diff options
context:
space:
mode:
authorBen Fuhrmannek2021-09-23 12:23:40 +0200
committerBen Fuhrmannek2021-09-23 12:23:40 +0200
commit54c352c1b5aa08b187dd1e52e544709cad2b0fee (patch)
treed15bf0f484c6baa1f2718e625e0d49f6fb488507 /src/sp_utils.h
parent887e1c9d44fbcf5f23a928269034593b8521aaba (diff)
config is stack allocated now + some code improvements (see details)
* for easier memory manegement, the entire sp_config struct was merged into snuffleupagus_globals and allocated on stack where possible * SNUFFLEUPAGUS_G() can be written as SPG(), which is faster to type and easier to read * execution_depth is re-initialized to 0 for each request * function calls with inline string and length parameters consistently use ZEND_STRL instead of sizeof()-1 * execution is actually hooked if recursion protection is enabled * some line breaks were removed to make the code more readable
Diffstat (limited to 'src/sp_utils.h')
-rw-r--r--src/sp_utils.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sp_utils.h b/src/sp_utils.h
index ef626a3..27c8bfa 100644
--- a/src/sp_utils.h
+++ b/src/sp_utils.h
@@ -23,10 +23,10 @@
23#define SHA256_SIZE 32 23#define SHA256_SIZE 32
24 24
25#define HOOK_FUNCTION(original_name, hook_table, new_function) \ 25#define HOOK_FUNCTION(original_name, hook_table, new_function) \
26 hook_function(original_name, SNUFFLEUPAGUS_G(hook_table), new_function) 26 hook_function(original_name, SPG(hook_table), new_function)
27 27
28#define HOOK_FUNCTION_BY_REGEXP(regexp, hook_table, new_function) \ 28#define HOOK_FUNCTION_BY_REGEXP(regexp, hook_table, new_function) \
29 hook_regexp(regexp, SNUFFLEUPAGUS_G(hook_table), new_function) 29 hook_regexp(regexp, SPG(hook_table), new_function)
30 30
31#define SP_TYPE_LOG (0) 31#define SP_TYPE_LOG (0)
32#define SP_TYPE_DROP (1) 32#define SP_TYPE_DROP (1)