ref 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. data/README.rdoc +35 -0
  2. data/VERSION +1 -0
  3. data/ext/java/org/jruby/ext/ref/ReferencesService.java +28 -0
  4. data/ext/java/org/jruby/ext/ref/RubySoftReference.java +43 -0
  5. data/ext/java/org/jruby/ext/ref/RubyWeakReference.java +43 -0
  6. data/lib/org/jruby/ext/ref/references.jar +0 -0
  7. data/lib/ref.rb +39 -0
  8. data/lib/ref/abstract_reference_key_map.rb +117 -0
  9. data/lib/ref/abstract_reference_value_map.rb +127 -0
  10. data/lib/ref/mock.rb +145 -0
  11. data/lib/ref/reference.rb +24 -0
  12. data/lib/ref/reference_queue.rb +89 -0
  13. data/lib/ref/safe_monitor.rb +50 -0
  14. data/lib/ref/soft_key_map.rb +26 -0
  15. data/lib/ref/soft_reference.rb +67 -0
  16. data/lib/ref/soft_value_map.rb +28 -0
  17. data/lib/ref/strong_reference.rb +17 -0
  18. data/lib/ref/weak_key_map.rb +26 -0
  19. data/lib/ref/weak_reference.rb +26 -0
  20. data/lib/ref/weak_reference/iron_ruby.rb +14 -0
  21. data/lib/ref/weak_reference/pure_ruby.rb +91 -0
  22. data/lib/ref/weak_reference/weak_ref.rb +23 -0
  23. data/lib/ref/weak_value_map.rb +27 -0
  24. data/test/reference_key_map_behavior.rb +157 -0
  25. data/test/reference_key_map_behavior.rbc +4296 -0
  26. data/test/reference_queue_test.rb +60 -0
  27. data/test/reference_queue_test.rbc +1954 -0
  28. data/test/reference_value_map_behavior.rb +137 -0
  29. data/test/reference_value_map_behavior.rbc +3615 -0
  30. data/test/soft_key_map_test.rb +13 -0
  31. data/test/soft_key_map_test.rbc +374 -0
  32. data/test/soft_reference_test.rb +49 -0
  33. data/test/soft_reference_test.rbc +1481 -0
  34. data/test/soft_value_map_test.rb +13 -0
  35. data/test/soft_value_map_test.rbc +374 -0
  36. data/test/strong_reference_test.rb +15 -0
  37. data/test/strong_reference_test.rbc +562 -0
  38. data/test/test_helper.rb +4 -0
  39. data/test/weak_key_map_test.rb +13 -0
  40. data/test/weak_key_map_test.rbc +374 -0
  41. data/test/weak_reference_test.rb +46 -0
  42. data/test/weak_reference_test.rbc +1254 -0
  43. data/test/weak_value_map_test.rb +13 -0
  44. data/test/weak_value_map_test.rbc +374 -0
  45. metadata +113 -0
@@ -0,0 +1,4 @@
1
+ require 'test/unit'
2
+ require File.expand_path("../../lib/ref", __FILE__)
3
+ require File.expand_path("../reference_key_map_behavior", __FILE__)
4
+ require File.expand_path("../reference_value_map_behavior", __FILE__)
@@ -0,0 +1,13 @@
1
+ require File.expand_path("../test_helper", __FILE__)
2
+
3
+ class TestWeakKeyMap < Test::Unit::TestCase
4
+ include ReferenceKeyMapBehavior
5
+
6
+ def map_class
7
+ Ref::WeakKeyMap
8
+ end
9
+
10
+ def reference_class
11
+ Ref::WeakReference
12
+ end
13
+ end
@@ -0,0 +1,374 @@
1
+ !RBIX
2
+ 0
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 82
13
+ 5
14
+ 7
15
+ 0
16
+ 64
17
+ 47
18
+ 49
19
+ 1
20
+ 1
21
+ 15
22
+ 5
23
+ 45
24
+ 2
25
+ 3
26
+ 7
27
+ 4
28
+ 64
29
+ 65
30
+ 49
31
+ 5
32
+ 0
33
+ 49
34
+ 6
35
+ 2
36
+ 47
37
+ 49
38
+ 1
39
+ 1
40
+ 15
41
+ 5
42
+ 45
43
+ 2
44
+ 7
45
+ 7
46
+ 8
47
+ 64
48
+ 65
49
+ 49
50
+ 5
51
+ 0
52
+ 49
53
+ 6
54
+ 2
55
+ 47
56
+ 49
57
+ 1
58
+ 1
59
+ 15
60
+ 99
61
+ 7
62
+ 9
63
+ 45
64
+ 10
65
+ 11
66
+ 43
67
+ 12
68
+ 43
69
+ 13
70
+ 65
71
+ 49
72
+ 14
73
+ 3
74
+ 13
75
+ 99
76
+ 12
77
+ 7
78
+ 15
79
+ 12
80
+ 7
81
+ 16
82
+ 12
83
+ 65
84
+ 12
85
+ 49
86
+ 17
87
+ 4
88
+ 15
89
+ 49
90
+ 15
91
+ 0
92
+ 15
93
+ 2
94
+ 11
95
+ I
96
+ 6
97
+ I
98
+ 0
99
+ I
100
+ 0
101
+ I
102
+ 0
103
+ n
104
+ p
105
+ 18
106
+ s
107
+ 9
108
+ test/unit
109
+ x
110
+ 7
111
+ require
112
+ x
113
+ 4
114
+ File
115
+ n
116
+ s
117
+ 13
118
+ ../../lib/ref
119
+ x
120
+ 11
121
+ active_path
122
+ x
123
+ 11
124
+ expand_path
125
+ n
126
+ s
127
+ 29
128
+ ../reference_key_map_behavior
129
+ x
130
+ 14
131
+ TestWeakKeyMap
132
+ x
133
+ 4
134
+ Test
135
+ n
136
+ x
137
+ 4
138
+ Unit
139
+ x
140
+ 8
141
+ TestCase
142
+ x
143
+ 10
144
+ open_class
145
+ x
146
+ 14
147
+ __class_init__
148
+ M
149
+ 1
150
+ n
151
+ n
152
+ x
153
+ 14
154
+ TestWeakKeyMap
155
+ i
156
+ 39
157
+ 5
158
+ 66
159
+ 5
160
+ 45
161
+ 0
162
+ 1
163
+ 47
164
+ 49
165
+ 2
166
+ 1
167
+ 15
168
+ 99
169
+ 7
170
+ 3
171
+ 7
172
+ 4
173
+ 65
174
+ 67
175
+ 49
176
+ 5
177
+ 0
178
+ 49
179
+ 6
180
+ 4
181
+ 15
182
+ 99
183
+ 7
184
+ 7
185
+ 7
186
+ 8
187
+ 65
188
+ 67
189
+ 49
190
+ 5
191
+ 0
192
+ 49
193
+ 6
194
+ 4
195
+ 11
196
+ I
197
+ 5
198
+ I
199
+ 0
200
+ I
201
+ 0
202
+ I
203
+ 0
204
+ n
205
+ p
206
+ 9
207
+ x
208
+ 23
209
+ ReferenceKeyMapBehavior
210
+ n
211
+ x
212
+ 7
213
+ include
214
+ x
215
+ 9
216
+ map_class
217
+ M
218
+ 1
219
+ n
220
+ n
221
+ x
222
+ 9
223
+ map_class
224
+ i
225
+ 6
226
+ 45
227
+ 0
228
+ 1
229
+ 43
230
+ 2
231
+ 11
232
+ I
233
+ 1
234
+ I
235
+ 0
236
+ I
237
+ 0
238
+ I
239
+ 0
240
+ n
241
+ p
242
+ 3
243
+ x
244
+ 3
245
+ Ref
246
+ n
247
+ x
248
+ 10
249
+ WeakKeyMap
250
+ p
251
+ 5
252
+ I
253
+ -1
254
+ I
255
+ 8
256
+ I
257
+ 0
258
+ I
259
+ 9
260
+ I
261
+ 6
262
+ x
263
+ 57
264
+ /Users/bdurand/dev/projects/ref/test/weak_key_map_test.rb
265
+ p
266
+ 0
267
+ x
268
+ 17
269
+ method_visibility
270
+ x
271
+ 15
272
+ add_defn_method
273
+ x
274
+ 15
275
+ reference_class
276
+ M
277
+ 1
278
+ n
279
+ n
280
+ x
281
+ 15
282
+ reference_class
283
+ i
284
+ 6
285
+ 45
286
+ 0
287
+ 1
288
+ 43
289
+ 2
290
+ 11
291
+ I
292
+ 1
293
+ I
294
+ 0
295
+ I
296
+ 0
297
+ I
298
+ 0
299
+ n
300
+ p
301
+ 3
302
+ x
303
+ 3
304
+ Ref
305
+ n
306
+ x
307
+ 13
308
+ WeakReference
309
+ p
310
+ 5
311
+ I
312
+ -1
313
+ I
314
+ c
315
+ I
316
+ 0
317
+ I
318
+ d
319
+ I
320
+ 6
321
+ x
322
+ 57
323
+ /Users/bdurand/dev/projects/ref/test/weak_key_map_test.rb
324
+ p
325
+ 0
326
+ p
327
+ 7
328
+ I
329
+ 2
330
+ I
331
+ 6
332
+ I
333
+ b
334
+ I
335
+ 8
336
+ I
337
+ 19
338
+ I
339
+ c
340
+ I
341
+ 27
342
+ x
343
+ 57
344
+ /Users/bdurand/dev/projects/ref/test/weak_key_map_test.rb
345
+ p
346
+ 0
347
+ x
348
+ 13
349
+ attach_method
350
+ p
351
+ 9
352
+ I
353
+ 0
354
+ I
355
+ 1
356
+ I
357
+ 9
358
+ I
359
+ 2
360
+ I
361
+ 1c
362
+ I
363
+ 3
364
+ I
365
+ 2f
366
+ I
367
+ 5
368
+ I
369
+ 52
370
+ x
371
+ 57
372
+ /Users/bdurand/dev/projects/ref/test/weak_key_map_test.rb
373
+ p
374
+ 0
@@ -0,0 +1,46 @@
1
+ require File.expand_path("../test_helper", __FILE__)
2
+
3
+ class TestWeakReference < Test::Unit::TestCase
4
+ def test_can_get_non_garbage_collected_objects
5
+ obj = Object.new
6
+ ref_1 = Ref::WeakReference.new(obj)
7
+ ref_2 = Ref::WeakReference.new(obj)
8
+ assert_equal obj, ref_1.object
9
+ assert_equal obj.object_id, ref_1.referenced_object_id
10
+ assert_equal obj, ref_2.object
11
+ assert_equal obj.object_id, ref_2.referenced_object_id
12
+ end
13
+
14
+ def test_get_the_correct_object
15
+ # Since we can't reliably control the garbage collector, this is a brute force test.
16
+ # It might not always fail if the garbage collector and memory allocator don't
17
+ # cooperate, but it should fail often enough on continuous integration to
18
+ # hilite any problems. Set the environment variable QUICK_TEST to "true" if you
19
+ # want to make the tests run quickly.
20
+ id_to_ref = {}
21
+ (ENV["QUICK_TEST"] == "true" ? 1000 : 100000).times do |i|
22
+ obj = Object.new
23
+ if id_to_ref.key?(obj.object_id)
24
+ ref = id_to_ref[obj.object_id]
25
+ if ref.object
26
+ flunk "weak reference found with a live reference to an object that was not the one it was created with"
27
+ break
28
+ end
29
+ end
30
+ %w(Here are a bunch of objects that are allocated and can then be cleaned up by the garbage collector)
31
+ id_to_ref[obj.object_id] = Ref::WeakReference.new(obj)
32
+ if i % 1000 == 0
33
+ GC.start
34
+ sleep(0.01)
35
+ end
36
+ end
37
+ end
38
+
39
+ def test_inspect
40
+ ref = Ref::WeakReference.new(Object.new)
41
+ assert ref.inspect
42
+ GC.start
43
+ GC.start
44
+ assert ref.inspect
45
+ end
46
+ end
@@ -0,0 +1,1254 @@
1
+ !RBIX
2
+ 0
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 63
13
+ 5
14
+ 7
15
+ 0
16
+ 64
17
+ 47
18
+ 49
19
+ 1
20
+ 1
21
+ 15
22
+ 5
23
+ 45
24
+ 2
25
+ 3
26
+ 7
27
+ 4
28
+ 64
29
+ 65
30
+ 49
31
+ 5
32
+ 0
33
+ 49
34
+ 6
35
+ 2
36
+ 47
37
+ 49
38
+ 1
39
+ 1
40
+ 15
41
+ 99
42
+ 7
43
+ 7
44
+ 45
45
+ 8
46
+ 9
47
+ 43
48
+ 10
49
+ 43
50
+ 11
51
+ 65
52
+ 49
53
+ 12
54
+ 3
55
+ 13
56
+ 99
57
+ 12
58
+ 7
59
+ 13
60
+ 12
61
+ 7
62
+ 14
63
+ 12
64
+ 65
65
+ 12
66
+ 49
67
+ 15
68
+ 4
69
+ 15
70
+ 49
71
+ 13
72
+ 0
73
+ 15
74
+ 2
75
+ 11
76
+ I
77
+ 6
78
+ I
79
+ 0
80
+ I
81
+ 0
82
+ I
83
+ 0
84
+ n
85
+ p
86
+ 16
87
+ s
88
+ 9
89
+ test/unit
90
+ x
91
+ 7
92
+ require
93
+ x
94
+ 4
95
+ File
96
+ n
97
+ s
98
+ 13
99
+ ../../lib/ref
100
+ x
101
+ 11
102
+ active_path
103
+ x
104
+ 11
105
+ expand_path
106
+ x
107
+ 17
108
+ TestWeakReference
109
+ x
110
+ 4
111
+ Test
112
+ n
113
+ x
114
+ 4
115
+ Unit
116
+ x
117
+ 8
118
+ TestCase
119
+ x
120
+ 10
121
+ open_class
122
+ x
123
+ 14
124
+ __class_init__
125
+ M
126
+ 1
127
+ n
128
+ n
129
+ x
130
+ 17
131
+ TestWeakReference
132
+ i
133
+ 44
134
+ 5
135
+ 66
136
+ 99
137
+ 7
138
+ 0
139
+ 7
140
+ 1
141
+ 65
142
+ 67
143
+ 49
144
+ 2
145
+ 0
146
+ 49
147
+ 3
148
+ 4
149
+ 15
150
+ 99
151
+ 7
152
+ 4
153
+ 7
154
+ 5
155
+ 65
156
+ 67
157
+ 49
158
+ 2
159
+ 0
160
+ 49
161
+ 3
162
+ 4
163
+ 15
164
+ 99
165
+ 7
166
+ 6
167
+ 7
168
+ 7
169
+ 65
170
+ 67
171
+ 49
172
+ 2
173
+ 0
174
+ 49
175
+ 3
176
+ 4
177
+ 11
178
+ I
179
+ 5
180
+ I
181
+ 0
182
+ I
183
+ 0
184
+ I
185
+ 0
186
+ n
187
+ p
188
+ 8
189
+ x
190
+ 42
191
+ test_can_get_non_garbage_collected_objects
192
+ M
193
+ 1
194
+ n
195
+ n
196
+ x
197
+ 42
198
+ test_can_get_non_garbage_collected_objects
199
+ i
200
+ 151
201
+ 45
202
+ 0
203
+ 1
204
+ 13
205
+ 71
206
+ 2
207
+ 47
208
+ 9
209
+ 21
210
+ 47
211
+ 49
212
+ 3
213
+ 0
214
+ 13
215
+ 47
216
+ 49
217
+ 4
218
+ 0
219
+ 15
220
+ 8
221
+ 24
222
+ 49
223
+ 2
224
+ 0
225
+ 19
226
+ 0
227
+ 15
228
+ 45
229
+ 5
230
+ 6
231
+ 43
232
+ 7
233
+ 13
234
+ 71
235
+ 2
236
+ 47
237
+ 9
238
+ 52
239
+ 47
240
+ 49
241
+ 3
242
+ 0
243
+ 13
244
+ 20
245
+ 0
246
+ 47
247
+ 49
248
+ 4
249
+ 1
250
+ 15
251
+ 8
252
+ 57
253
+ 20
254
+ 0
255
+ 49
256
+ 2
257
+ 1
258
+ 19
259
+ 1
260
+ 15
261
+ 45
262
+ 5
263
+ 8
264
+ 43
265
+ 7
266
+ 13
267
+ 71
268
+ 2
269
+ 47
270
+ 9
271
+ 85
272
+ 47
273
+ 49
274
+ 3
275
+ 0
276
+ 13
277
+ 20
278
+ 0
279
+ 47
280
+ 49
281
+ 4
282
+ 1
283
+ 15
284
+ 8
285
+ 90
286
+ 20
287
+ 0
288
+ 49
289
+ 2
290
+ 1
291
+ 19
292
+ 2
293
+ 15
294
+ 5
295
+ 20
296
+ 0
297
+ 20
298
+ 1
299
+ 49
300
+ 9
301
+ 0
302
+ 47
303
+ 49
304
+ 10
305
+ 2
306
+ 15
307
+ 5
308
+ 20
309
+ 0
310
+ 49
311
+ 11
312
+ 0
313
+ 20
314
+ 1
315
+ 49
316
+ 12
317
+ 0
318
+ 47
319
+ 49
320
+ 10
321
+ 2
322
+ 15
323
+ 5
324
+ 20
325
+ 0
326
+ 20
327
+ 2
328
+ 49
329
+ 9
330
+ 0
331
+ 47
332
+ 49
333
+ 10
334
+ 2
335
+ 15
336
+ 5
337
+ 20
338
+ 0
339
+ 49
340
+ 11
341
+ 0
342
+ 20
343
+ 2
344
+ 49
345
+ 12
346
+ 0
347
+ 47
348
+ 49
349
+ 10
350
+ 2
351
+ 11
352
+ I
353
+ 6
354
+ I
355
+ 3
356
+ I
357
+ 0
358
+ I
359
+ 0
360
+ n
361
+ p
362
+ 13
363
+ x
364
+ 6
365
+ Object
366
+ n
367
+ x
368
+ 3
369
+ new
370
+ x
371
+ 8
372
+ allocate
373
+ x
374
+ 10
375
+ initialize
376
+ x
377
+ 3
378
+ Ref
379
+ n
380
+ x
381
+ 13
382
+ WeakReference
383
+ n
384
+ x
385
+ 6
386
+ object
387
+ x
388
+ 12
389
+ assert_equal
390
+ x
391
+ 9
392
+ object_id
393
+ x
394
+ 20
395
+ referenced_object_id
396
+ p
397
+ 17
398
+ I
399
+ -1
400
+ I
401
+ 5
402
+ I
403
+ 0
404
+ I
405
+ 6
406
+ I
407
+ 1b
408
+ I
409
+ 7
410
+ I
411
+ 3c
412
+ I
413
+ 8
414
+ I
415
+ 5d
416
+ I
417
+ 9
418
+ I
419
+ 6a
420
+ I
421
+ a
422
+ I
423
+ 7a
424
+ I
425
+ b
426
+ I
427
+ 87
428
+ I
429
+ c
430
+ I
431
+ 97
432
+ x
433
+ 59
434
+ /Users/bdurand/dev/projects/ref/test/weak_reference_test.rb
435
+ p
436
+ 3
437
+ x
438
+ 3
439
+ obj
440
+ x
441
+ 5
442
+ ref_1
443
+ x
444
+ 5
445
+ ref_2
446
+ x
447
+ 17
448
+ method_visibility
449
+ x
450
+ 15
451
+ add_defn_method
452
+ x
453
+ 27
454
+ test_get_the_correct_object
455
+ M
456
+ 1
457
+ n
458
+ n
459
+ x
460
+ 27
461
+ test_get_the_correct_object
462
+ i
463
+ 38
464
+ 44
465
+ 43
466
+ 0
467
+ 78
468
+ 49
469
+ 1
470
+ 1
471
+ 19
472
+ 0
473
+ 15
474
+ 45
475
+ 2
476
+ 3
477
+ 7
478
+ 4
479
+ 64
480
+ 49
481
+ 5
482
+ 1
483
+ 7
484
+ 6
485
+ 64
486
+ 83
487
+ 7
488
+ 9
489
+ 30
490
+ 7
491
+ 8
492
+ 8
493
+ 32
494
+ 7
495
+ 9
496
+ 56
497
+ 10
498
+ 50
499
+ 11
500
+ 0
501
+ 11
502
+ I
503
+ 3
504
+ I
505
+ 1
506
+ I
507
+ 0
508
+ I
509
+ 0
510
+ n
511
+ p
512
+ 12
513
+ x
514
+ 4
515
+ Hash
516
+ x
517
+ 16
518
+ new_from_literal
519
+ x
520
+ 3
521
+ ENV
522
+ n
523
+ s
524
+ 10
525
+ QUICK_TEST
526
+ x
527
+ 2
528
+ []
529
+ s
530
+ 4
531
+ true
532
+ x
533
+ 2
534
+ ==
535
+ I
536
+ 3e8
537
+ I
538
+ 186a0
539
+ M
540
+ 1
541
+ p
542
+ 2
543
+ x
544
+ 9
545
+ for_block
546
+ t
547
+ n
548
+ x
549
+ 27
550
+ test_get_the_correct_object
551
+ i
552
+ 219
553
+ 57
554
+ 19
555
+ 0
556
+ 15
557
+ 45
558
+ 0
559
+ 1
560
+ 13
561
+ 71
562
+ 2
563
+ 47
564
+ 9
565
+ 25
566
+ 47
567
+ 49
568
+ 3
569
+ 0
570
+ 13
571
+ 47
572
+ 49
573
+ 4
574
+ 0
575
+ 15
576
+ 8
577
+ 28
578
+ 49
579
+ 2
580
+ 0
581
+ 19
582
+ 1
583
+ 15
584
+ 21
585
+ 1
586
+ 0
587
+ 20
588
+ 1
589
+ 49
590
+ 5
591
+ 0
592
+ 49
593
+ 6
594
+ 1
595
+ 9
596
+ 81
597
+ 21
598
+ 1
599
+ 0
600
+ 20
601
+ 1
602
+ 49
603
+ 5
604
+ 0
605
+ 49
606
+ 7
607
+ 1
608
+ 19
609
+ 2
610
+ 15
611
+ 20
612
+ 2
613
+ 49
614
+ 8
615
+ 0
616
+ 9
617
+ 78
618
+ 5
619
+ 7
620
+ 9
621
+ 64
622
+ 47
623
+ 49
624
+ 10
625
+ 1
626
+ 15
627
+ 1
628
+ 33
629
+ 8
630
+ 79
631
+ 1
632
+ 8
633
+ 82
634
+ 1
635
+ 15
636
+ 7
637
+ 11
638
+ 64
639
+ 7
640
+ 12
641
+ 64
642
+ 7
643
+ 13
644
+ 64
645
+ 7
646
+ 14
647
+ 64
648
+ 7
649
+ 15
650
+ 64
651
+ 7
652
+ 16
653
+ 64
654
+ 7
655
+ 17
656
+ 64
657
+ 7
658
+ 12
659
+ 64
660
+ 7
661
+ 18
662
+ 64
663
+ 7
664
+ 19
665
+ 64
666
+ 7
667
+ 20
668
+ 64
669
+ 7
670
+ 21
671
+ 64
672
+ 7
673
+ 22
674
+ 64
675
+ 7
676
+ 23
677
+ 64
678
+ 7
679
+ 24
680
+ 64
681
+ 7
682
+ 25
683
+ 64
684
+ 7
685
+ 26
686
+ 64
687
+ 7
688
+ 27
689
+ 64
690
+ 7
691
+ 28
692
+ 64
693
+ 35
694
+ 19
695
+ 15
696
+ 21
697
+ 1
698
+ 0
699
+ 20
700
+ 1
701
+ 49
702
+ 5
703
+ 0
704
+ 45
705
+ 29
706
+ 30
707
+ 43
708
+ 31
709
+ 13
710
+ 71
711
+ 2
712
+ 47
713
+ 9
714
+ 176
715
+ 47
716
+ 49
717
+ 3
718
+ 0
719
+ 13
720
+ 20
721
+ 1
722
+ 47
723
+ 49
724
+ 4
725
+ 1
726
+ 15
727
+ 8
728
+ 181
729
+ 20
730
+ 1
731
+ 49
732
+ 2
733
+ 1
734
+ 13
735
+ 18
736
+ 3
737
+ 49
738
+ 32
739
+ 2
740
+ 15
741
+ 15
742
+ 20
743
+ 0
744
+ 7
745
+ 33
746
+ 49
747
+ 34
748
+ 1
749
+ 78
750
+ 83
751
+ 35
752
+ 9
753
+ 217
754
+ 45
755
+ 36
756
+ 37
757
+ 49
758
+ 38
759
+ 0
760
+ 15
761
+ 5
762
+ 7
763
+ 39
764
+ 47
765
+ 49
766
+ 40
767
+ 1
768
+ 8
769
+ 218
770
+ 1
771
+ 11
772
+ I
773
+ 17
774
+ I
775
+ 3
776
+ I
777
+ 1
778
+ I
779
+ 1
780
+ n
781
+ p
782
+ 41
783
+ x
784
+ 6
785
+ Object
786
+ n
787
+ x
788
+ 3
789
+ new
790
+ x
791
+ 8
792
+ allocate
793
+ x
794
+ 10
795
+ initialize
796
+ x
797
+ 9
798
+ object_id
799
+ x
800
+ 4
801
+ key?
802
+ x
803
+ 2
804
+ []
805
+ x
806
+ 6
807
+ object
808
+ s
809
+ 96
810
+ weak reference found with a live reference to an object that was not the one it was created with
811
+ x
812
+ 5
813
+ flunk
814
+ s
815
+ 4
816
+ Here
817
+ s
818
+ 3
819
+ are
820
+ s
821
+ 1
822
+ a
823
+ s
824
+ 5
825
+ bunch
826
+ s
827
+ 2
828
+ of
829
+ s
830
+ 7
831
+ objects
832
+ s
833
+ 4
834
+ that
835
+ s
836
+ 9
837
+ allocated
838
+ s
839
+ 3
840
+ and
841
+ s
842
+ 3
843
+ can
844
+ s
845
+ 4
846
+ then
847
+ s
848
+ 2
849
+ be
850
+ s
851
+ 7
852
+ cleaned
853
+ s
854
+ 2
855
+ up
856
+ s
857
+ 2
858
+ by
859
+ s
860
+ 3
861
+ the
862
+ s
863
+ 7
864
+ garbage
865
+ s
866
+ 9
867
+ collector
868
+ x
869
+ 3
870
+ Ref
871
+ n
872
+ x
873
+ 13
874
+ WeakReference
875
+ x
876
+ 3
877
+ []=
878
+ I
879
+ 3e8
880
+ x
881
+ 1
882
+ %
883
+ x
884
+ 2
885
+ ==
886
+ x
887
+ 2
888
+ GC
889
+ n
890
+ x
891
+ 5
892
+ start
893
+ d
894
+ +0.640000000000000013322676295501878485083580017089843750 -6
895
+ x
896
+ 5
897
+ sleep
898
+ p
899
+ 31
900
+ I
901
+ 0
902
+ I
903
+ 16
904
+ I
905
+ 4
906
+ I
907
+ 17
908
+ I
909
+ 1f
910
+ I
911
+ 18
912
+ I
913
+ 2c
914
+ I
915
+ 19
916
+ I
917
+ 3a
918
+ I
919
+ 1a
920
+ I
921
+ 41
922
+ I
923
+ 1b
924
+ I
925
+ 4a
926
+ I
927
+ 1c
928
+ I
929
+ 4e
930
+ I
931
+ 1a
932
+ I
933
+ 51
934
+ I
935
+ 18
936
+ I
937
+ 53
938
+ I
939
+ 1f
940
+ I
941
+ 8f
942
+ I
943
+ 20
944
+ I
945
+ bd
946
+ I
947
+ 21
948
+ I
949
+ c9
950
+ I
951
+ 22
952
+ I
953
+ d0
954
+ I
955
+ 23
956
+ I
957
+ d9
958
+ I
959
+ 21
960
+ I
961
+ db
962
+ x
963
+ 59
964
+ /Users/bdurand/dev/projects/ref/test/weak_reference_test.rb
965
+ p
966
+ 3
967
+ x
968
+ 1
969
+ i
970
+ x
971
+ 3
972
+ obj
973
+ x
974
+ 3
975
+ ref
976
+ x
977
+ 5
978
+ times
979
+ p
980
+ 7
981
+ I
982
+ -1
983
+ I
984
+ f
985
+ I
986
+ 0
987
+ I
988
+ 15
989
+ I
990
+ a
991
+ I
992
+ 16
993
+ I
994
+ 26
995
+ x
996
+ 59
997
+ /Users/bdurand/dev/projects/ref/test/weak_reference_test.rb
998
+ p
999
+ 1
1000
+ x
1001
+ 9
1002
+ id_to_ref
1003
+ x
1004
+ 12
1005
+ test_inspect
1006
+ M
1007
+ 1
1008
+ n
1009
+ n
1010
+ x
1011
+ 12
1012
+ test_inspect
1013
+ i
1014
+ 113
1015
+ 45
1016
+ 0
1017
+ 1
1018
+ 43
1019
+ 2
1020
+ 13
1021
+ 71
1022
+ 3
1023
+ 47
1024
+ 9
1025
+ 47
1026
+ 47
1027
+ 49
1028
+ 4
1029
+ 0
1030
+ 13
1031
+ 45
1032
+ 5
1033
+ 6
1034
+ 13
1035
+ 71
1036
+ 3
1037
+ 47
1038
+ 9
1039
+ 37
1040
+ 47
1041
+ 49
1042
+ 4
1043
+ 0
1044
+ 13
1045
+ 47
1046
+ 49
1047
+ 7
1048
+ 0
1049
+ 15
1050
+ 8
1051
+ 40
1052
+ 49
1053
+ 3
1054
+ 0
1055
+ 47
1056
+ 49
1057
+ 7
1058
+ 1
1059
+ 15
1060
+ 8
1061
+ 74
1062
+ 45
1063
+ 5
1064
+ 8
1065
+ 13
1066
+ 71
1067
+ 3
1068
+ 47
1069
+ 9
1070
+ 68
1071
+ 47
1072
+ 49
1073
+ 4
1074
+ 0
1075
+ 13
1076
+ 47
1077
+ 49
1078
+ 7
1079
+ 0
1080
+ 15
1081
+ 8
1082
+ 71
1083
+ 49
1084
+ 3
1085
+ 0
1086
+ 49
1087
+ 3
1088
+ 1
1089
+ 19
1090
+ 0
1091
+ 15
1092
+ 5
1093
+ 20
1094
+ 0
1095
+ 49
1096
+ 9
1097
+ 0
1098
+ 47
1099
+ 49
1100
+ 10
1101
+ 1
1102
+ 15
1103
+ 45
1104
+ 11
1105
+ 12
1106
+ 49
1107
+ 13
1108
+ 0
1109
+ 15
1110
+ 45
1111
+ 11
1112
+ 14
1113
+ 49
1114
+ 13
1115
+ 0
1116
+ 15
1117
+ 5
1118
+ 20
1119
+ 0
1120
+ 49
1121
+ 9
1122
+ 0
1123
+ 47
1124
+ 49
1125
+ 10
1126
+ 1
1127
+ 11
1128
+ I
1129
+ 5
1130
+ I
1131
+ 1
1132
+ I
1133
+ 0
1134
+ I
1135
+ 0
1136
+ n
1137
+ p
1138
+ 15
1139
+ x
1140
+ 3
1141
+ Ref
1142
+ n
1143
+ x
1144
+ 13
1145
+ WeakReference
1146
+ x
1147
+ 3
1148
+ new
1149
+ x
1150
+ 8
1151
+ allocate
1152
+ x
1153
+ 6
1154
+ Object
1155
+ n
1156
+ x
1157
+ 10
1158
+ initialize
1159
+ n
1160
+ x
1161
+ 7
1162
+ inspect
1163
+ x
1164
+ 6
1165
+ assert
1166
+ x
1167
+ 2
1168
+ GC
1169
+ n
1170
+ x
1171
+ 5
1172
+ start
1173
+ n
1174
+ p
1175
+ 13
1176
+ I
1177
+ -1
1178
+ I
1179
+ 28
1180
+ I
1181
+ 0
1182
+ I
1183
+ 29
1184
+ I
1185
+ 4d
1186
+ I
1187
+ 2a
1188
+ I
1189
+ 58
1190
+ I
1191
+ 2b
1192
+ I
1193
+ 5f
1194
+ I
1195
+ 2c
1196
+ I
1197
+ 66
1198
+ I
1199
+ 2d
1200
+ I
1201
+ 71
1202
+ x
1203
+ 59
1204
+ /Users/bdurand/dev/projects/ref/test/weak_reference_test.rb
1205
+ p
1206
+ 1
1207
+ x
1208
+ 3
1209
+ ref
1210
+ p
1211
+ 7
1212
+ I
1213
+ 2
1214
+ I
1215
+ 5
1216
+ I
1217
+ 10
1218
+ I
1219
+ f
1220
+ I
1221
+ 1e
1222
+ I
1223
+ 28
1224
+ I
1225
+ 2c
1226
+ x
1227
+ 59
1228
+ /Users/bdurand/dev/projects/ref/test/weak_reference_test.rb
1229
+ p
1230
+ 0
1231
+ x
1232
+ 13
1233
+ attach_method
1234
+ p
1235
+ 7
1236
+ I
1237
+ 0
1238
+ I
1239
+ 1
1240
+ I
1241
+ 9
1242
+ I
1243
+ 2
1244
+ I
1245
+ 1c
1246
+ I
1247
+ 4
1248
+ I
1249
+ 3f
1250
+ x
1251
+ 59
1252
+ /Users/bdurand/dev/projects/ref/test/weak_reference_test.rb
1253
+ p
1254
+ 0