Path: blob/master/thirdparty/pcre2/deps/sljit/sljit_src/sljitConfig.h
9917 views
/*1* Stack-less Just-In-Time compiler2*3* Copyright Zoltan Herczeg ([email protected]). All rights reserved.4*5* Redistribution and use in source and binary forms, with or without modification, are6* permitted provided that the following conditions are met:7*8* 1. Redistributions of source code must retain the above copyright notice, this list of9* conditions and the following disclaimer.10*11* 2. Redistributions in binary form must reproduce the above copyright notice, this list12* of conditions and the following disclaimer in the documentation and/or other materials13* provided with the distribution.14*15* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND CONTRIBUTORS ``AS IS'' AND ANY16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES17* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT18* SHALL THE COPYRIGHT HOLDER(S) OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,19* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED20* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR21* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN22* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN23* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.24*/2526#ifndef SLJIT_CONFIG_H_27#define SLJIT_CONFIG_H_2829#ifdef __cplusplus30extern "C" {31#endif /* __cplusplus */3233/*34This file contains the basic configuration options for the SLJIT compiler35and their default values. These options can be overridden in the36sljitConfigPre.h header file when SLJIT_HAVE_CONFIG_PRE is set to a37non-zero value.38*/3940/* --------------------------------------------------------------------- */41/* Utilities */42/* --------------------------------------------------------------------- */4344/* Implements a stack like data structure (by using mmap / VirtualAlloc */45/* or a custom allocator). */46#ifndef SLJIT_UTIL_STACK47/* Enabled by default */48#define SLJIT_UTIL_STACK 149#endif /* SLJIT_UTIL_STACK */5051/* Uses user provided allocator to allocate the stack (see SLJIT_UTIL_STACK) */52#ifndef SLJIT_UTIL_SIMPLE_STACK_ALLOCATION53/* Disabled by default */54#define SLJIT_UTIL_SIMPLE_STACK_ALLOCATION 055#endif /* SLJIT_UTIL_SIMPLE_STACK_ALLOCATION */5657/* Single threaded application. Does not require any locks. */58#ifndef SLJIT_SINGLE_THREADED59/* Disabled by default. */60#define SLJIT_SINGLE_THREADED 061#endif /* SLJIT_SINGLE_THREADED */6263/* --------------------------------------------------------------------- */64/* Configuration */65/* --------------------------------------------------------------------- */6667/* If SLJIT_STD_MACROS_DEFINED is not defined, the application should68define SLJIT_MALLOC, SLJIT_FREE, SLJIT_MEMCPY, and NULL. */69#ifndef SLJIT_STD_MACROS_DEFINED70/* Disabled by default. */71#define SLJIT_STD_MACROS_DEFINED 072#endif /* SLJIT_STD_MACROS_DEFINED */7374/* Executable code allocation:75If SLJIT_EXECUTABLE_ALLOCATOR is not defined, the application should76define SLJIT_MALLOC_EXEC and SLJIT_FREE_EXEC.77Optionally, depending on the implementation used for the allocator,78SLJIT_EXEC_OFFSET and SLJIT_UPDATE_WX_FLAGS might also be needed. */79#ifndef SLJIT_EXECUTABLE_ALLOCATOR80/* Enabled by default. */81#define SLJIT_EXECUTABLE_ALLOCATOR 18283/* When SLJIT_PROT_EXECUTABLE_ALLOCATOR is enabled SLJIT uses84an allocator which does not set writable and executable85permission flags at the same time.86Instead, it creates a shared memory segment (usually backed by a file)87and maps it twice, with different permissions, depending on the use88case.89The trade-off is increased use of virtual memory, incompatibility with90fork(), and some possible additional security risks by the use of91publicly accessible files for the generated code. */92#ifndef SLJIT_PROT_EXECUTABLE_ALLOCATOR93/* Disabled by default. */94#define SLJIT_PROT_EXECUTABLE_ALLOCATOR 095#endif /* SLJIT_PROT_EXECUTABLE_ALLOCATOR */9697/* When SLJIT_WX_EXECUTABLE_ALLOCATOR is enabled SLJIT uses an98allocator which does not set writable and executable permission99flags at the same time.100Instead, it creates a new independent map on each invocation and101switches permissions at the underlying pages as needed.102The trade-off is increased memory use and degraded performance. */103#ifndef SLJIT_WX_EXECUTABLE_ALLOCATOR104/* Disabled by default. */105#define SLJIT_WX_EXECUTABLE_ALLOCATOR 0106#endif /* SLJIT_WX_EXECUTABLE_ALLOCATOR */107108#endif /* !SLJIT_EXECUTABLE_ALLOCATOR */109110/* Return with error when an invalid argument is passed. */111#ifndef SLJIT_ARGUMENT_CHECKS112/* Disabled by default */113#define SLJIT_ARGUMENT_CHECKS 0114#endif /* SLJIT_ARGUMENT_CHECKS */115116/* Debug checks (assertions, etc.). */117#ifndef SLJIT_DEBUG118/* Enabled by default */119#define SLJIT_DEBUG 1120#endif /* SLJIT_DEBUG */121122/* Verbose operations. */123#ifndef SLJIT_VERBOSE124/* Enabled by default */125#define SLJIT_VERBOSE 1126#endif /* SLJIT_VERBOSE */127128/*129SLJIT_IS_FPU_AVAILABLE130The availability of the FPU can be controlled by SLJIT_IS_FPU_AVAILABLE.131zero value - FPU is NOT present.132nonzero value - FPU is present.133*/134135/* For further configurations, see the beginning of sljitConfigInternal.h */136137#ifdef __cplusplus138} /* extern "C" */139#endif /* __cplusplus */140141#endif /* SLJIT_CONFIG_H_ */142143144