diff options
author | zherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2011-10-31 06:10:14 +0000 |
---|---|---|
committer | zherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2011-10-31 06:10:14 +0000 |
commit | a29ff98c9e8af311491720b4b61281ee707dafc2 (patch) | |
tree | 96f2cce4e694baf7cb26309ac8ab468db41da204 /sljit/sljitConfigInternal.h | |
parent | adb232d7233c9a3e8d4bde718215395f937e8fb2 (diff) | |
download | pcre-a29ff98c9e8af311491720b4b61281ee707dafc2.tar.gz |
Updating the JIT compiler
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@740 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'sljit/sljitConfigInternal.h')
-rw-r--r-- | sljit/sljitConfigInternal.h | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/sljit/sljitConfigInternal.h b/sljit/sljitConfigInternal.h index e82bed7..8ba1bb8 100644 --- a/sljit/sljitConfigInternal.h +++ b/sljit/sljitConfigInternal.h @@ -129,6 +129,7 @@ /* General allocation. */ #define SLJIT_MALLOC(size) malloc(size) +#define SLJIT_MALLOC_ZEROED(size) calloc((size), 1) #define SLJIT_FREE(ptr) free(ptr) #define SLJIT_MEMMOVE(dest, src, len) memmove(dest, src, len) @@ -161,6 +162,20 @@ #define SLJIT_UNUSED_ARG(arg) (void)arg #endif +#if (defined SLJIT_CONFIG_STATIC && SLJIT_CONFIG_STATIC) +/* Static ABI functions. For all-in-one programs. */ + +#if defined(__GNUC__) +/* Disable unused warnings in gcc. */ +#define SLJIT_API_FUNC_ATTRIBUTE static __attribute__((unused)) +#else +#define SLJIT_API_FUNC_ATTRIBUTE static +#endif + +#else +#define SLJIT_API_FUNC_ATTRIBUTE +#endif /* (defined SLJIT_CONFIG_STATIC && SLJIT_CONFIG_STATIC) */ + #ifndef SLJIT_CACHE_FLUSH #if !(defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) && !(defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) @@ -332,11 +347,14 @@ void sljit_free_exec(void* ptr); /* Feel free to redefine these two macros. */ #ifndef SLJIT_ASSERT +#define SLJIT_HALT_PROCESS() \ + *((int*)0) = 0 + #define SLJIT_ASSERT(x) \ do { \ if (SLJIT_UNLIKELY(!(x))) { \ printf("Assertion failed at " __FILE__ ":%d\n", __LINE__); \ - *((int*)0) = 0; \ + SLJIT_HALT_PROCESS(); \ } \ } while (0) @@ -347,7 +365,7 @@ void sljit_free_exec(void* ptr); #define SLJIT_ASSERT_STOP() \ do { \ printf("Should never been reached " __FILE__ ":%d\n", __LINE__); \ - *((int*)0) = 0; \ + SLJIT_HALT_PROCESS(); \ } while (0) #endif /* !SLJIT_ASSERT_STOP */ @@ -364,4 +382,12 @@ void sljit_free_exec(void* ptr); #endif /* (defined SLJIT_DEBUG && SLJIT_DEBUG) */ +#ifndef SLJIT_COMPILE_ASSERT + +/* Should be improved eventually. */ +#define SLJIT_COMPILE_ASSERT(x, description) \ + SLJIT_ASSERT(x) + +#endif /* !SLJIT_COMPILE_ASSERT */ + #endif |