# Interrupt in \*

**URL:** <https://www.ruby-forum.com/t/interrupt-in/123635>\
**Category:** Development\
**Created:** [December 19, 2007, 11:31am UTC](https://www.ruby-forum.com/t/interrupt-in/123635 "2007-12-19T11:31:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tanaka\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c67d28/32.png) [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Post date:** [December 19, 2007, 11:31am UTC](https://www.ruby-forum.com/t/interrupt-in/123635/1 "2007-12-19T11:31:03Z")

</div>

e$B0J2\<$N$h$&$K$7$F!"e(B\* e$B$N4V$Ke(B ^C e$B$G3d$j9~$s$@8e!"e(B  
e$B$9$Y$F$N%\*%V%8%’%/%H$re(B p e$B$7$F$\_$k$H!"0[\>o=\*N;$7$^$9!#e(B

% ./ruby -e ‘n = 10\*\*100000  
begin  
n \* n  
rescue Interrupt  
p $!  
end  
ObjectSpace.each\_object {|o|  
begin  
p o  
rescue IOError  
end  
}  
’  
(n \* n e$B$N7W;;$r$7$F$$$k4V$Ge(B ^C e$B$G3d$j9~$`e(B) Interrupt "Interrupt" "Interrupt" "-e:3:in`_’"  
"_"  
"-e:3:in `<main>'" ["-e:3:in`\*’", “-e:3:in `’”]  
Interrupt  
“”  
…  
-e:9: – control frame ----------  
c:0009 p:---- s:0019 b:0019 l:000018 d:000018 CFUNC :to\_s  
c:0008 p:---- s:0017 b:0017 l:000016 d:000016 CFUNC :inspect  
c:0007 p:---- s:0015 b:0015 l:000014 d:000014 CFUNC 😛  
c:0006 p:0010 s:0011 b:0011 l:000005 d:000010 BLOCK -e:9  
c:0005 p:---- s:0011 b:0011 l:000010 d:000010 FINISH 😛  
c:0004 p:---- s:0009 b:0009 l:000008 d:000008 CFUNC :each\_object  
c:0003 p:0032 s:0006 b:0006 l:000005 d:000005 TOP -e:7  
c:0002 p:---- s:0003 b:0003 l:000002 d:000002 FINISH :inherited  
c:0001 p:---- s:0001 b:-001 l:000000 d:000000 ------

---

<div class="post-metadata">

**Author:** ![Tanaka\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c67d28/32.png) [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Post date:** [December 19, 2007, 8:39pm UTC](https://www.ruby-forum.com/t/interrupt-in/123635/2 "2007-12-19T20:39:05Z")

</div>

e$B!!$5$5$@$G$9!%e(B

Tanaka A. wrote:

> e$B0J2\<$N$h$&$K$7$F!"e(B\* e$B$N4V$Ke(B ^C e$B$G3d$j9~$s$@8e!"e(B  
> e$B$9$Y$F$N%\*%V%8%’%/%H$re(B p e$B$7$F$\_$k$H!"0[\>o=\*N;$7$^$9!#e(B

e$B!!e(BSIGINT e$B$N=hM}$GIT40A4$Je(B bignum  
e$B$,;D$C$A$c$C$?$+$i$+$J$"$H;W$C$?$se(B  
e$B$G$9$,!$e(BSIGINT e$B$GCfCG$7$J$/$F$bH/@8$9$k$h$&$G$9!%C1$Ke(B to\_s  
e$B$KLdBj$,e(B  
e$B$"$k!)e(B

---

<div class="post-metadata">

**Author:** ![Tanaka\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c67d28/32.png) [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Post date:** [December 20, 2007, 12:58am UTC](https://www.ruby-forum.com/t/interrupt-in/123635/3 "2007-12-20T00:58:18Z")

</div>

e$B1sF#$H?=$7$^$9!#e(B

07/12/20 e$B$Ke(B SASADA Koichi[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) e$B$5$s$O=q$-$^$7$?e(B:

> Tanaka A. wrote:
> 
> > e$B0J2\<$N$h$&$K$7$F!"e(B\* e$B$N4V$Ke(B ^C e$B$G3d$j9~$s$@8e!"e(B  
> > e$B$9$Y$F$N%\*%V%8%'%/%H$re(B p e$B$7$F$\_$k$H!"0[\>o=\*N;$7$^$9!#e(B

e$BLdBj$r4JC1$K$G$-$^$7$?!#0J2\<$r\<B9T$9$k$@$1$GMn$A$^$9!#e(B  
e$B$^$?!"e(B[ruby-dev:32634] e$B$Ne(B Interrupt  
e$B$N%Q%C%A$rEv$F$kA0$Ne(B  
ruby e$B$G$bMn$A$^$9!#e(B

GC.stress = true  
n = 10 \*\* 20000  
ObjectSpace.each\_object(Bignum) {|o| o.to\_s }  
ObjectSpace.each\_object(Bignum) {|o| o.to\_s }

> e$B!!e(BSIGINT e$B$N=hM}$GIT40A4$Je(B bignum e$B$,;D$C$A$c$C$?$+$i$+$J$“$H;W$C$?$se(B  
> e$B$G$9$,!$e(BSIGINT e$B$GCfCG$7$J$/$F$bH/@8$9$k$h$&$G$9!%C1$Ke(B to\_s e$B$KLdBj$,e(B  
> e$B$”$k!)e(B

e$B$d$O$j860x$Oe(B to\_s e$B$N%P%0$@$H;W$$$^$9!#HO0O%A%'%C%/$,$^$:$/$Fe(B  
BDIGITS e$B$N30B&$K%“%/%;%9$7$F!”%R!\<%W$r$V$A2u$7$F$$$k$h$&$G$9!#e(B

# Index: bignum.c

— bignum.c (revision 14348)  
+++ bignum.c (working copy)  
@@ -837,12 +837,12 @@  
while (k–) {  
ptr[–j] = ruby\_digitmap[num % base];  
num /= base;

- 

```
       if (!trim && j <= 0) break;

```

- 

```
       if (j <= 0) break;
       if (trim && i == 0 && num == 0) break;
   }

```

}  
if (trim) {

- 

```
   while (ptr[j] == '0') j++;

```

- 

```
   while (j < len && ptr[j] == '0') j++;
   MEMMOVE(ptr, ptr + j, char, len - j);
   len -= j;

```

}
