# DL::PtrData#inspect

**URL:** <https://www.ruby-forum.com/t/dl-ptrdata-inspect/88465>\
**Category:** Development\
**Created:** [March 11, 2007, 4:22pm UTC](https://www.ruby-forum.com/t/dl-ptrdata-inspect/88465 "2007-03-11T16:22:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sheepman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepman](https://www.ruby-forum.com/u/sheepman)\
**Post date:** [March 11, 2007, 4:22pm UTC](https://www.ruby-forum.com/t/dl-ptrdata-inspect/88465/1 "2007-03-11T16:22:56Z")

</div>

e$B$3$s$P$s$O!"e(Bsheepman e$B$G$9!#e(B

DL::PtrData e$B$He(B DL::Symbol e$B$Ne(B inspect e$B$,e(B

$ ruby-1.8.5 -rdl -e ‘p DL::Symbol.new(0, “a”, “I”)’  
#\<DL::Symbol:0x0x811d210 func=0x(nil) ‘void ((null))()’\>

e$B$H$$$&$U$&$K!Ve(B0xe$B!W$r=E$M$F=PNO$7$F$7$^$$$^$9!#e(B  
e$B0J2\<$O%Q%C%A$G$9!#e(B

# $ svn diff ptr.c sym.c L -S Index: ptr.c

— ptr.c (revision 12023)  
+++ ptr.c (working copy)  
@@ -466,7 +466,7 @@  
char str[1024];

Data\_Get\_Struct(self, struct ptr\_data, data);

- snprintf(str, 1023, “#\<%s:0x%p ptr=0x%p size=%ld free=0x%p\>”,

- snprintf(str, 1023, “#\<%s:0x%x ptr=0x%x size=%ld free=0x%x\>”,  
rb\_class2name(CLASS\_OF(self)), data, data-\>ptr, data-\>size,  
data-\>free);  
return rb\_str\_new2(str);  
}  
Index: sym.c  
===================================================================  
— sym.c (revision 12023)  
+++ sym.c (working copy)  
@@ -268,7 +268,7 @@  
str\_size = RSTRING(proto)-\>len + 100;  
str = dlmalloc(str\_size);  
snprintf(str, str\_size - 1,

- 

```
     "#<DL::Symbol:0x%p func=0x%p '%s'>",

```

- 

```
     "#<DL::Symbol:0x%x func=0x%x '%s'>",
     sym, sym->func, RSTRING(proto)->ptr);

```

val = rb\_tainted\_str\_new2(str);  
dlfree(str);

---

<div class="post-metadata">

**Author:** ![sheepman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepman](https://www.ruby-forum.com/u/sheepman)\
**Post date:** [March 11, 2007, 5:13pm UTC](https://www.ruby-forum.com/t/dl-ptrdata-inspect/88465/2 "2007-03-11T17:13:02Z")

</div>

At Mon, 12 Mar 2007 00:21:57 +0900,  
sheepman wrote:

> DL::PtrData ã¨ DL::Symbol ã® inspect ãŒ
> 
> $ ruby-1.8.5 -rdl -e ‘p DL::Symbol.new(0, “a”, “I”)’  
> #\<DL::Symbol:0x0x811d210 func=0x(nil) ‘void ((null))()’\>
> 
> ã¨ã„ã†ãµã†ã«ã€Œ0xã€ã‚’é‡ã­ã¦å‡ºåŠ›ã—ã¦ã—ã¾ã„ã¾ã™ã€‚  
> ä»¥ä¸‹ã¯ãƒ‘ãƒƒãƒã§ã™ã€‚

ã€€ãƒã‚¤ãƒ³ã‚¿ã‚’ 0x%x ã§è¡¨ç¤ºã•ã‚Œã¦ã‚‚ã†ã‚Œã—ããªã„ç’°å¢ƒã¯ãã“ãã“ã‚ã‚Šãã†  
ã§ã™ãŒã€ã»ã‹ã®ç®‡æ‰€ã§ã‚‚ %p ã§ãªã 0x%x ã«ãªã£ã¦ã„ã‚‹ã®ã§ã€å–ã‚Šè¾¼ã‚€  
ã“ã¨ã«ã—ã¾ã—ãŸã€‚ã‚ã‚ŠãŒã¨ã†ã”ã–ã„ã¾ã™ã€‚

–  
/  
/\_\_ \_\_ [Akinori.org](http://Akinori.org) / [MUSHA.org](http://MUSHA.org)  
/ ) ) ) ) / [FreeBSD.org](http://FreeBSD.org) / [Ruby-lang.org](http://Ruby-lang.org)  
Akinori MUSHA aka / (\_ / ( (\_\_( @ [iDaemons.org](http://iDaemons.org) / and.or.jp

“Different eyes see different things,  
Different hearts beat on different strings –  
But there are times for you and me when all such things agree”

---

<div class="post-metadata">

**Author:** ![sheepman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepman](https://www.ruby-forum.com/u/sheepman)\
**Post date:** [March 12, 2007, 8:41am UTC](https://www.ruby-forum.com/t/dl-ptrdata-inspect/88465/3 "2007-03-12T08:41:49Z")

</div>

e$BKNIt$G$9!#e(B

Akinori MUSHA wrote:

> e$B!!%]%$%s%?$re(B 0x%x e$B$GI=\<($5$l$F$b$&$l$7$/$J$$4D6-$O$=$3$=$3$"$j$=$&e(B  
> e$B$G$9$,!"$[$+$N2U=j$G$be(B %p e$B$G$J$/e(B 0x%x e$B$K$J$C$F$$$k$N$G!"\<h$j9~$`e(B  
> e$B$3$H$K$7$^$7$?!#$"$j$,$H$&$4$6$$$^$9!#e(B

e$B\<ALd$G$9!#e(B%#xe$B$G$O$J$/e(B0x%xe$B$H$9$k$N$K$O$J$s$+$N0U?^$,$"$k$N$G$9$+e(B?

# 0x%Xe$B$H$+$J$i$^$@M}2r$G$-$ke(B

---

<div class="post-metadata">

**Author:** ![sheepman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepman](https://www.ruby-forum.com/u/sheepman)\
**Post date:** [March 12, 2007, 8:53am UTC](https://www.ruby-forum.com/t/dl-ptrdata-inspect/88465/4 "2007-03-12T08:53:49Z")

</div>

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:30541] Re: DL::PtrData#inspect”  
on Mon, 12 Mar 2007 16:40:39 +0900, Urabe S.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

|e$B\<ALd$G$9!#e(B%#xe$B$G$O$J$/e(B0x%xe$B$H$9$k$N$K$O$J$s$+$N0U?^$,$"$k$N$G$9$+e(B?

e$B!Ve(B%#xe$B!W$,$I$3$G$b;H$($k3N?.$,L5$+$C$?$+$i$G$9!#$H$j$"$($:e(B  
e$B!Ve(B0x%xe$B!W$J$i$I$3$G$b;H$($=$&$@$C$?$7!#e(B

|# 0x%Xe$B$H$+$J$i$^$@M}2r$G$-$ke(B

e$B$I$&$7$F!)e(B

---

<div class="post-metadata">

**Author:** ![sheepman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepman](https://www.ruby-forum.com/u/sheepman)\
**Post date:** [March 12, 2007, 10:19am UTC](https://www.ruby-forum.com/t/dl-ptrdata-inspect/88465/5 "2007-03-12T10:19:59Z")

</div>

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:30544] Re: DL::PtrData#inspect”  
on Mon, 12 Mar 2007 18:15:19 +0900, Urabe S.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

|Yukihiro M. wrote:  
|\> e$B!Ve(B%#xe$B!W$,$I$3$G$b;H$($k3N?.$,L5$+$C$?$+$i$G$9!#$H$j$“$($:e(B  
|\> e$B!Ve(B0x%xe$B!W$J$i$I$3$G$b;H$($=$&$@$C$?$7!#e(B  
|  
|e$B\<BAu$ND4::$^$G$O$d$C$F$^$;$s$,e(BSUSv2e$B$K$bF~$C$F$k$3$H$@$7!”;H$($J$$4D6-$He(B  
|e$B$$$&$N$b8+$?$3$H$,$J$$$G$9!#e(B

e$B$&!\<$s!"e(BRubye$B$N3+H/$r;O$a$?$N$Oe(BSUSv2e$B$h$jA0$G$9$+$i$M$(!#e(B

---

<div class="post-metadata">

**Author:** ![sheepman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepman](https://www.ruby-forum.com/u/sheepman)\
**Post date:** [March 12, 2007, 10:15am UTC](https://www.ruby-forum.com/t/dl-ptrdata-inspect/88465/6 "2007-03-12T10:15:59Z")

</div>

e$BKNIt$G$9!#e(B

Yukihiro M. wrote:

> e$B!Ve(B%#xe$B!W$,$I$3$G$b;H$($k3N?.$,L5$+$C$?$+$i$G$9!#$H$j$"$($:e(B  
> e$B!Ve(B0x%xe$B!W$J$i$I$3$G$b;H$($=$&$@$C$?$7!#e(B

e$B\<BAu$ND4::$^$G$O$d$C$F$^$;$s$,e(BSUSv2e$B$K$bF~$C$F$k$3$H$@$7!";H$($J$$4D6-$He(B  
e$B$$$&$N$b8+$?$3$H$,$J$$$G$9!#e(B

> |# 0x%Xe$B$H$+$J$i$^$@M}2r$G$-$ke(B
> 
> e$B$I$&$7$F!)e(B

0xDEADBEEFe$B$N$h$&$Ke(Bxe$B$@$1\>.J8;z$K$9$kN.GI$,$"$k$h$&$G$9!#e(B%#Xe$B$@$He(B0XDEADBEEF  
e$B$H$+$K$J$C$F$7$^$&$N$G!"e(Bxe$B$@$1\>.J8;z$K$7$?$1$l$Pe(B  
0x%Xe$B$H$$$&;XDj$OM}2r$G$-e(B  
e$B$^$9!#e(B
