github.com/goccy/go-jit@v0.0.0-20200514131505-ff78d45cf6af/internal/ccall/include/jit/jit-context.h (about)

     1  /*
     2   * jit-context.h - Functions for manipulating JIT contexts.
     3   *
     4   * Copyright (C) 2004  Southern Storm Software, Pty Ltd.
     5   *
     6   * The libjit library is free software: you can redistribute it and/or
     7   * modify it under the terms of the GNU Lesser General Public License
     8   * as published by the Free Software Foundation, either version 2.1 of
     9   * the License, or (at your option) any later version.
    10   *
    11   * The libjit library is distributed in the hope that it will be useful,
    12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
    13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    14   * Lesser General Public License for more details.
    15   *
    16   * You should have received a copy of the GNU Lesser General Public
    17   * License along with the libjit library.  If not, see
    18   * <http://www.gnu.org/licenses/>.
    19   */
    20  
    21  #ifndef	_JIT_CONTEXT_H
    22  #define	_JIT_CONTEXT_H
    23  
    24  #include <jit/jit-common.h>
    25  #include <jit/jit-memory.h>
    26  
    27  #ifdef	__cplusplus
    28  extern	"C" {
    29  #endif
    30  
    31  jit_context_t jit_context_create(void) JIT_NOTHROW;
    32  void jit_context_destroy(jit_context_t context) JIT_NOTHROW;
    33  
    34  void jit_context_build_start(jit_context_t context) JIT_NOTHROW;
    35  void jit_context_build_end(jit_context_t context) JIT_NOTHROW;
    36  
    37  void jit_context_set_on_demand_driver(
    38  	jit_context_t context,
    39  	jit_on_demand_driver_func driver) JIT_NOTHROW;
    40  
    41  void jit_context_set_memory_manager(
    42  	jit_context_t context,
    43  	jit_memory_manager_t manager) JIT_NOTHROW;
    44  
    45  int jit_context_set_meta
    46  	(jit_context_t context, int type, void *data,
    47  	 jit_meta_free_func free_data) JIT_NOTHROW;
    48  int jit_context_set_meta_numeric
    49  	(jit_context_t context, int type, jit_nuint data) JIT_NOTHROW;
    50  void *jit_context_get_meta(jit_context_t context, int type) JIT_NOTHROW;
    51  jit_nuint jit_context_get_meta_numeric
    52  	(jit_context_t context, int type) JIT_NOTHROW;
    53  void jit_context_free_meta(jit_context_t context, int type) JIT_NOTHROW;
    54  
    55  /*
    56   * Standard meta values for builtin configurable options.
    57   */
    58  #define	JIT_OPTION_CACHE_LIMIT		10000
    59  #define	JIT_OPTION_CACHE_PAGE_SIZE	10001
    60  #define	JIT_OPTION_PRE_COMPILE		10002
    61  #define	JIT_OPTION_DONT_FOLD		10003
    62  #define JIT_OPTION_POSITION_INDEPENDENT	10004
    63  #define JIT_OPTION_CACHE_MAX_PAGE_FACTOR	10005
    64  
    65  #ifdef	__cplusplus
    66  };
    67  #endif
    68  
    69  #endif /* _JIT_CONTEXT_H */