File tree Expand file tree Collapse file tree 4 files changed +4
-3
lines changed
lib/gems/gems/rbs-2.7.0/core
src/main/ruby/truffleruby/core Expand file tree Collapse file tree 4 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ Performance:
85
85
86
86
* Marking of native structures wrapped in objects is now done on C call exit to reduce memory overhead (@aardvark179 ).
87
87
* Splitting (copying) of call targets has been optimized by implementing ` cloneUninitialized() ` (@andrykonchin , @eregon ).
88
+ * ` Process.pid ` is now cached per process like ` $$ ` (#2882 , @horakivo )
88
89
89
90
Changes:
90
91
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ $!: Exception | nil
5
5
$": Array[String]
6
6
7
7
# The process number of the Ruby running this script. Same as Process.pid.
8
- $$: Integer
8
+ $$: Integer | nil
9
9
10
10
# The string matched by the last successful match.
11
11
$&: String | nil
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ def p(*a)
86
86
end
87
87
88
88
Truffle ::Boot . delay do
89
- $$ = Process . pid if Truffle ::POSIX ::NATIVE
89
+ $$ = Truffle ::POSIX ::NATIVE ? Truffle :: POSIX . getpid : nil
90
90
91
91
ARGV . concat ( Truffle ::Boot . original_argv )
92
92
end
Original file line number Diff line number Diff line change @@ -343,7 +343,7 @@ def getpgrp
343
343
end
344
344
345
345
def pid
346
- Truffle :: POSIX . getpid
346
+ $$ or raise SecurityError , 'native access is not allowed'
347
347
end
348
348
349
349
def ppid
You can’t perform that action at this time.
0 commit comments