Try to fix Windows build
This commit is contained in:
parent
a3e58f4df8
commit
7d1546ece5
1
iseq.c
1
iseq.c
@ -42,7 +42,6 @@
|
|||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "insns.inc"
|
#include "insns.inc"
|
||||||
#include "insns_info.inc"
|
#include "insns_info.inc"
|
||||||
#include <sys/mman.h>
|
|
||||||
|
|
||||||
VALUE rb_cISeq;
|
VALUE rb_cISeq;
|
||||||
static VALUE iseqw_new(const rb_iseq_t *iseq);
|
static VALUE iseqw_new(const rb_iseq_t *iseq);
|
||||||
|
@ -3,8 +3,10 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
// For mmapp()
|
// For mmapp()
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "ujit_asm.h"
|
#include "ujit_asm.h"
|
||||||
|
|
||||||
@ -82,6 +84,7 @@ x86opnd_t const_ptr_opnd(void* ptr)
|
|||||||
// Allocate a block of executable memory
|
// Allocate a block of executable memory
|
||||||
uint8_t* alloc_exec_mem(size_t mem_size)
|
uint8_t* alloc_exec_mem(size_t mem_size)
|
||||||
{
|
{
|
||||||
|
#ifndef _WIN32
|
||||||
// Map the memory as executable
|
// Map the memory as executable
|
||||||
uint8_t* mem_block = (uint8_t*)mmap(
|
uint8_t* mem_block = (uint8_t*)mmap(
|
||||||
&alloc_exec_mem,
|
&alloc_exec_mem,
|
||||||
@ -100,6 +103,9 @@ uint8_t* alloc_exec_mem(size_t mem_size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return mem_block;
|
return mem_block;
|
||||||
|
#else
|
||||||
|
return NULL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize a code block object
|
// Initialize a code block object
|
||||||
|
@ -13,6 +13,12 @@
|
|||||||
// eg ujit_hook.h
|
// eg ujit_hook.h
|
||||||
#include "ujit_examples.inc"
|
#include "ujit_examples.inc"
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define PLATFORM_SUPPORTED_P 0
|
||||||
|
#else
|
||||||
|
#define PLATFORM_SUPPORTED_P 1
|
||||||
|
#endif
|
||||||
|
|
||||||
// Hash table of encoded instructions
|
// Hash table of encoded instructions
|
||||||
extern st_table *rb_encoded_insn_data;
|
extern st_table *rb_encoded_insn_data;
|
||||||
|
|
||||||
@ -505,7 +511,7 @@ rb_ujit_enabled_p(void)
|
|||||||
void
|
void
|
||||||
rb_ujit_init(void)
|
rb_ujit_init(void)
|
||||||
{
|
{
|
||||||
if (!ujit_scrape_successful) {
|
if (!ujit_scrape_successful && PLATFORM_SUPPORTED_P) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Initialize the code blocks
|
// Initialize the code blocks
|
||||||
|
Loading…
x
Reference in New Issue
Block a user