[#70252] Re: [ruby-cvs:58640] nobu:r51492 (trunk): node.c: NODE_ALLOCA for ALLOCV — Eric Wong <normalperson@...>
Besides possible backwards compatibility, can we drop volatile
3 messages
2015/08/05
[#70257] [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI — ko1@...
Issue #11420 has been reported by Koichi Sasada.
11 messages
2015/08/06
[#70337] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— Eric Wong <normalperson@...>
2015/08/11
Nice. Thank you guys for looking into this.
[#70349] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— Eric Wong <normalperson@...>
2015/08/12
Btw, did you consider using flexible array to avoid extra malloc
[#70355] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— Юрий Соколов <funny.falcon@...>
2015/08/12
I thought to suggest to embed hash_id_table directly into places when it is
[#70356] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— SASADA Koichi <ko1@...>
2015/08/12
On 2015/08/13 4:29, Юрий Соколов wrote:
[#70358] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— Eric Wong <normalperson@...>
2015/08/12
SASADA Koichi <ko1@atdot.net> wrote:
[#70509] [Ruby trunk - Misc #11276] [RFC] compile.c: convert to use ccan/list — ko1@...
Issue #11276 has been updated by Koichi Sasada.
3 messages
2015/08/21
[#70639] the undefined behavior of an iterator if it is modified inside of the block to which it yields — Daniel Doubrovkine <dblock@...>
(this is my first time e-mailing list list, so apologies for any misstep :)
4 messages
2015/08/31
[ruby-core:70282] [Ruby trunk - Feature #10211] Implement Signal.current_trap(sig)
From:
silin@...
Date:
2015-08-09 13:00:23 UTC
List:
ruby-core #70282
Issue #10211 has been updated by Kyrylo Silin.
I think we can close this. Thanks everyone for help! I finally figured out how to do that without modifying Ruby.
I updated https://github.com/kyrylo/multitrap
----------------------------------------
Feature #10211: Implement Signal.current_trap(sig)
https://bugs.ruby-lang.org/issues/10211#change-53706
* Author: Kyrylo Silin
* Status: Feedback
* Priority: Normal
* Assignee:
----------------------------------------
Here's pseudocode by ko1:
~~~
def trap2(sig)
previous_proc = Signal.current_trap(sig)
Signal.trap(sig){
previous_proc.call if previous_proc
yield
}
end
trap2(:INT){...}
~~~
## Motivation
I'm developing a gem that allows using multiple callbacks for a trap: [[https://github.com/kyrylo/multitrap]]
It's pretty simple (and slightly broken). The problem is that if you earlier had defined traps and then
required my library, it would discard your previously defined callbacks.
The library overrides `Signal.trap` and stores callbacks in a hash. However, it stores only new callbacks.
I cannot access previously defined callbacks for signals. They are stored in `GET_VM()->trap_list`, which
isn't exposed neither to Ruby nor to the C extension API. I know when you define a `trap`, it returns a proc.
However, nobody typicaly stores it, so there's no way to access it. So if my gem loads after this assignment,
I'm unable to capture that proc, hence I always overwrite previous "traps". This library might be useful if you
want to define a trap that conflicts with some other gem you depend on, which defines its own trap for the
same signal.
So I need some way to access the callbacks.
--
https://bugs.ruby-lang.org/