jit_buffer 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -2
- data/lib/jit_buffer.rb +10 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83c506373263745dc1425c011b5c87fb19e09056aa15193397e7a947490c6f69
|
4
|
+
data.tar.gz: 1b0b9ae7fba8f3a3da5eb92cd426e411cfdce42c7e6142c9b42308dd59e61cc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab2ec25089b2a6037ca5c266e2cd51dc1228ab224c0662a768d7692491d9178d9d5491750c184090e9ec892d6dead2cca23dae89093cd90ec829262d1a3287ac
|
7
|
+
data.tar.gz: 3ca332072bdb7fecd76b5978ac6d39058f509ae61ab05a4539c1ba1548bea0d81a3fadac5e48c8b622a348a6f6931362f511f79f8611a4283f6e9e8882077066
|
data/README.md
CHANGED
data/lib/jit_buffer.rb
CHANGED
@@ -8,7 +8,7 @@ class Fiddle::Function
|
|
8
8
|
end unless Fiddle::Function.method_defined?(:to_proc)
|
9
9
|
|
10
10
|
class JITBuffer
|
11
|
-
VERSION = '1.0.
|
11
|
+
VERSION = '1.0.5'
|
12
12
|
|
13
13
|
class Exception < StandardError
|
14
14
|
end
|
@@ -70,22 +70,22 @@ class JITBuffer
|
|
70
70
|
|
71
71
|
if respond_to?(:pthread_jit_write_protect_np)
|
72
72
|
# MacOS
|
73
|
-
def self.set_writeable ptr
|
73
|
+
def self.set_writeable ptr, _
|
74
74
|
MMAP.pthread_jit_write_protect_np 0
|
75
75
|
end
|
76
76
|
|
77
|
-
def self.set_executable ptr
|
77
|
+
def self.set_executable ptr, size
|
78
78
|
MMAP.pthread_jit_write_protect_np 1
|
79
|
-
MMAP.sys_icache_invalidate ptr,
|
79
|
+
MMAP.sys_icache_invalidate ptr, size
|
80
80
|
end
|
81
81
|
else
|
82
82
|
# Linux
|
83
|
-
def self.set_writeable ptr
|
84
|
-
MMAP.mprotect ptr,
|
83
|
+
def self.set_writeable ptr, size
|
84
|
+
MMAP.mprotect ptr, size, PROT_READ | PROT_WRITE
|
85
85
|
end
|
86
86
|
|
87
|
-
def self.set_executable ptr
|
88
|
-
MMAP.mprotect ptr,
|
87
|
+
def self.set_executable ptr, size
|
88
|
+
MMAP.mprotect ptr, size, PROT_READ | PROT_EXEC
|
89
89
|
end
|
90
90
|
end
|
91
91
|
end
|
@@ -145,12 +145,12 @@ class JITBuffer
|
|
145
145
|
end
|
146
146
|
|
147
147
|
def executable!
|
148
|
-
MMAP.set_executable @memory.to_i
|
148
|
+
MMAP.set_executable @memory.to_i, @size
|
149
149
|
@writeable = false
|
150
150
|
end
|
151
151
|
|
152
152
|
def writeable!
|
153
|
-
MMAP.set_writeable @memory.to_i
|
153
|
+
MMAP.set_writeable @memory.to_i, @size
|
154
154
|
@writeable = true
|
155
155
|
end
|
156
156
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jit_buffer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Patterson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|