Commit 8eab55b
Make pointer size consistent between backends (#183)
This PR makes the pointer size consistent between backends. Follow up to
#179.
```ruby
require "fiddle"
ptr = Fiddle::Pointer.new(0)
p ptr.size
p ptr.ref.size
ptr = Fiddle::Pointer["hello world"]
ptr.size = 0
p ptr.to_s
p ptr.to_str
```
JRuby + TruffleRuby before
```text
9223372036854775807
8
""
""
```
CRuby + JRuby + TruffleRuby after
```text
0
0
"hello world"
""
```
---------
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>1 parent 6ffba40 commit 8eab55b
2 files changed
+18
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
326 | | - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
327 | 333 | | |
328 | 334 | | |
329 | 335 | | |
| |||
413 | 419 | | |
414 | 420 | | |
415 | 421 | | |
| 422 | + | |
| 423 | + | |
416 | 424 | | |
417 | 425 | | |
418 | 426 | | |
| |||
486 | 494 | | |
487 | 495 | | |
488 | 496 | | |
| 497 | + | |
489 | 498 | | |
490 | 499 | | |
491 | 500 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
| |||
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
96 | 102 | | |
97 | 103 | | |
98 | 104 | | |
| |||
256 | 262 | | |
257 | 263 | | |
258 | 264 | | |
| 265 | + | |
| 266 | + | |
259 | 267 | | |
260 | 268 | | |
261 | 269 | | |
| |||
0 commit comments