ref 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
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,60 @@
1
+ require File.expand_path("../test_helper", __FILE__)
2
+
3
+ class TestReferenceQueue < Test::Unit::TestCase
4
+ def test_can_add_references
5
+ queue = Ref::ReferenceQueue.new
6
+ ref_1 = Ref::WeakReference.new(Object.new)
7
+ ref_2 = Ref::WeakReference.new(Object.new)
8
+ assert queue.empty?
9
+ assert_equal 0, queue.size
10
+ queue.push(ref_1)
11
+ queue.push(ref_2)
12
+ assert !queue.empty?
13
+ assert_equal 2, queue.size
14
+ end
15
+
16
+ def test_can_remove_references_as_a_queue
17
+ queue = Ref::ReferenceQueue.new
18
+ ref_1 = Ref::WeakReference.new(Object.new)
19
+ ref_2 = Ref::WeakReference.new(Object.new)
20
+ queue.push(ref_1)
21
+ queue.push(ref_2)
22
+ assert_equal ref_1, queue.shift
23
+ assert_equal ref_2, queue.shift
24
+ assert_nil queue.shift
25
+ end
26
+
27
+ def test_can_remove_references_as_a_stack
28
+ queue = Ref::ReferenceQueue.new
29
+ ref_1 = Ref::WeakReference.new(Object.new)
30
+ ref_2 = Ref::WeakReference.new(Object.new)
31
+ queue.push(ref_1)
32
+ queue.push(ref_2)
33
+ assert_equal ref_2, queue.pop
34
+ assert_equal ref_1, queue.pop
35
+ assert_nil queue.pop
36
+ end
37
+
38
+ def test_references_are_added_when_the_object_has_been_collected
39
+ Ref::Mock.use do
40
+ obj = Object.new
41
+ ref = Ref::WeakReference.new(obj)
42
+ queue = Ref::ReferenceQueue.new
43
+ queue.monitor(ref)
44
+ assert_nil queue.shift
45
+ Ref::Mock.gc(obj)
46
+ assert_equal ref, queue.shift
47
+ end
48
+ end
49
+
50
+ def test_references_are_added_immediately_if_the_object_has_been_collected
51
+ Ref::Mock.use do
52
+ obj = Object.new
53
+ ref = Ref::WeakReference.new(obj)
54
+ Ref::Mock.gc(obj)
55
+ queue = Ref::ReferenceQueue.new
56
+ queue.monitor(ref)
57
+ assert_equal ref, queue.shift
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,1954 @@
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
+ 18
108
+ TestReferenceQueue
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
+ 18
131
+ TestReferenceQueue
132
+ i
133
+ 72
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
+ 15
178
+ 99
179
+ 7
180
+ 8
181
+ 7
182
+ 9
183
+ 65
184
+ 67
185
+ 49
186
+ 2
187
+ 0
188
+ 49
189
+ 3
190
+ 4
191
+ 15
192
+ 99
193
+ 7
194
+ 10
195
+ 7
196
+ 11
197
+ 65
198
+ 67
199
+ 49
200
+ 2
201
+ 0
202
+ 49
203
+ 3
204
+ 4
205
+ 11
206
+ I
207
+ 5
208
+ I
209
+ 0
210
+ I
211
+ 0
212
+ I
213
+ 0
214
+ n
215
+ p
216
+ 12
217
+ x
218
+ 23
219
+ test_can_add_references
220
+ M
221
+ 1
222
+ n
223
+ n
224
+ x
225
+ 23
226
+ test_can_add_references
227
+ i
228
+ 251
229
+ 45
230
+ 0
231
+ 1
232
+ 43
233
+ 2
234
+ 13
235
+ 71
236
+ 3
237
+ 47
238
+ 9
239
+ 23
240
+ 47
241
+ 49
242
+ 4
243
+ 0
244
+ 13
245
+ 47
246
+ 49
247
+ 5
248
+ 0
249
+ 15
250
+ 8
251
+ 26
252
+ 49
253
+ 3
254
+ 0
255
+ 19
256
+ 0
257
+ 15
258
+ 45
259
+ 0
260
+ 6
261
+ 43
262
+ 7
263
+ 13
264
+ 71
265
+ 3
266
+ 47
267
+ 9
268
+ 76
269
+ 47
270
+ 49
271
+ 4
272
+ 0
273
+ 13
274
+ 45
275
+ 8
276
+ 9
277
+ 13
278
+ 71
279
+ 3
280
+ 47
281
+ 9
282
+ 66
283
+ 47
284
+ 49
285
+ 4
286
+ 0
287
+ 13
288
+ 47
289
+ 49
290
+ 5
291
+ 0
292
+ 15
293
+ 8
294
+ 69
295
+ 49
296
+ 3
297
+ 0
298
+ 47
299
+ 49
300
+ 5
301
+ 1
302
+ 15
303
+ 8
304
+ 103
305
+ 45
306
+ 8
307
+ 10
308
+ 13
309
+ 71
310
+ 3
311
+ 47
312
+ 9
313
+ 97
314
+ 47
315
+ 49
316
+ 4
317
+ 0
318
+ 13
319
+ 47
320
+ 49
321
+ 5
322
+ 0
323
+ 15
324
+ 8
325
+ 100
326
+ 49
327
+ 3
328
+ 0
329
+ 49
330
+ 3
331
+ 1
332
+ 19
333
+ 1
334
+ 15
335
+ 45
336
+ 0
337
+ 11
338
+ 43
339
+ 7
340
+ 13
341
+ 71
342
+ 3
343
+ 47
344
+ 9
345
+ 153
346
+ 47
347
+ 49
348
+ 4
349
+ 0
350
+ 13
351
+ 45
352
+ 8
353
+ 12
354
+ 13
355
+ 71
356
+ 3
357
+ 47
358
+ 9
359
+ 143
360
+ 47
361
+ 49
362
+ 4
363
+ 0
364
+ 13
365
+ 47
366
+ 49
367
+ 5
368
+ 0
369
+ 15
370
+ 8
371
+ 146
372
+ 49
373
+ 3
374
+ 0
375
+ 47
376
+ 49
377
+ 5
378
+ 1
379
+ 15
380
+ 8
381
+ 180
382
+ 45
383
+ 8
384
+ 13
385
+ 13
386
+ 71
387
+ 3
388
+ 47
389
+ 9
390
+ 174
391
+ 47
392
+ 49
393
+ 4
394
+ 0
395
+ 13
396
+ 47
397
+ 49
398
+ 5
399
+ 0
400
+ 15
401
+ 8
402
+ 177
403
+ 49
404
+ 3
405
+ 0
406
+ 49
407
+ 3
408
+ 1
409
+ 19
410
+ 2
411
+ 15
412
+ 5
413
+ 20
414
+ 0
415
+ 49
416
+ 14
417
+ 0
418
+ 47
419
+ 49
420
+ 15
421
+ 1
422
+ 15
423
+ 5
424
+ 78
425
+ 20
426
+ 0
427
+ 49
428
+ 16
429
+ 0
430
+ 47
431
+ 49
432
+ 17
433
+ 2
434
+ 15
435
+ 20
436
+ 0
437
+ 20
438
+ 1
439
+ 49
440
+ 18
441
+ 1
442
+ 15
443
+ 20
444
+ 0
445
+ 20
446
+ 2
447
+ 49
448
+ 18
449
+ 1
450
+ 15
451
+ 5
452
+ 20
453
+ 0
454
+ 49
455
+ 14
456
+ 0
457
+ 10
458
+ 233
459
+ 2
460
+ 8
461
+ 234
462
+ 3
463
+ 47
464
+ 49
465
+ 15
466
+ 1
467
+ 15
468
+ 5
469
+ 80
470
+ 20
471
+ 0
472
+ 49
473
+ 16
474
+ 0
475
+ 47
476
+ 49
477
+ 17
478
+ 2
479
+ 11
480
+ I
481
+ 7
482
+ I
483
+ 3
484
+ I
485
+ 0
486
+ I
487
+ 0
488
+ n
489
+ p
490
+ 19
491
+ x
492
+ 3
493
+ Ref
494
+ n
495
+ x
496
+ 14
497
+ ReferenceQueue
498
+ x
499
+ 3
500
+ new
501
+ x
502
+ 8
503
+ allocate
504
+ x
505
+ 10
506
+ initialize
507
+ n
508
+ x
509
+ 13
510
+ WeakReference
511
+ x
512
+ 6
513
+ Object
514
+ n
515
+ n
516
+ n
517
+ n
518
+ n
519
+ x
520
+ 6
521
+ empty?
522
+ x
523
+ 6
524
+ assert
525
+ x
526
+ 4
527
+ size
528
+ x
529
+ 12
530
+ assert_equal
531
+ x
532
+ 4
533
+ push
534
+ p
535
+ 21
536
+ I
537
+ -1
538
+ I
539
+ 5
540
+ I
541
+ 0
542
+ I
543
+ 6
544
+ I
545
+ 1d
546
+ I
547
+ 7
548
+ I
549
+ 6a
550
+ I
551
+ 8
552
+ I
553
+ b7
554
+ I
555
+ 9
556
+ I
557
+ c2
558
+ I
559
+ a
560
+ I
561
+ ce
562
+ I
563
+ b
564
+ I
565
+ d6
566
+ I
567
+ c
568
+ I
569
+ de
570
+ I
571
+ d
572
+ I
573
+ ef
574
+ I
575
+ e
576
+ I
577
+ fb
578
+ x
579
+ 60
580
+ /Users/bdurand/dev/projects/ref/test/reference_queue_test.rb
581
+ p
582
+ 3
583
+ x
584
+ 5
585
+ queue
586
+ x
587
+ 5
588
+ ref_1
589
+ x
590
+ 5
591
+ ref_2
592
+ x
593
+ 17
594
+ method_visibility
595
+ x
596
+ 15
597
+ add_defn_method
598
+ x
599
+ 37
600
+ test_can_remove_references_as_a_queue
601
+ M
602
+ 1
603
+ n
604
+ n
605
+ x
606
+ 37
607
+ test_can_remove_references_as_a_queue
608
+ i
609
+ 236
610
+ 45
611
+ 0
612
+ 1
613
+ 43
614
+ 2
615
+ 13
616
+ 71
617
+ 3
618
+ 47
619
+ 9
620
+ 23
621
+ 47
622
+ 49
623
+ 4
624
+ 0
625
+ 13
626
+ 47
627
+ 49
628
+ 5
629
+ 0
630
+ 15
631
+ 8
632
+ 26
633
+ 49
634
+ 3
635
+ 0
636
+ 19
637
+ 0
638
+ 15
639
+ 45
640
+ 0
641
+ 6
642
+ 43
643
+ 7
644
+ 13
645
+ 71
646
+ 3
647
+ 47
648
+ 9
649
+ 76
650
+ 47
651
+ 49
652
+ 4
653
+ 0
654
+ 13
655
+ 45
656
+ 8
657
+ 9
658
+ 13
659
+ 71
660
+ 3
661
+ 47
662
+ 9
663
+ 66
664
+ 47
665
+ 49
666
+ 4
667
+ 0
668
+ 13
669
+ 47
670
+ 49
671
+ 5
672
+ 0
673
+ 15
674
+ 8
675
+ 69
676
+ 49
677
+ 3
678
+ 0
679
+ 47
680
+ 49
681
+ 5
682
+ 1
683
+ 15
684
+ 8
685
+ 103
686
+ 45
687
+ 8
688
+ 10
689
+ 13
690
+ 71
691
+ 3
692
+ 47
693
+ 9
694
+ 97
695
+ 47
696
+ 49
697
+ 4
698
+ 0
699
+ 13
700
+ 47
701
+ 49
702
+ 5
703
+ 0
704
+ 15
705
+ 8
706
+ 100
707
+ 49
708
+ 3
709
+ 0
710
+ 49
711
+ 3
712
+ 1
713
+ 19
714
+ 1
715
+ 15
716
+ 45
717
+ 0
718
+ 11
719
+ 43
720
+ 7
721
+ 13
722
+ 71
723
+ 3
724
+ 47
725
+ 9
726
+ 153
727
+ 47
728
+ 49
729
+ 4
730
+ 0
731
+ 13
732
+ 45
733
+ 8
734
+ 12
735
+ 13
736
+ 71
737
+ 3
738
+ 47
739
+ 9
740
+ 143
741
+ 47
742
+ 49
743
+ 4
744
+ 0
745
+ 13
746
+ 47
747
+ 49
748
+ 5
749
+ 0
750
+ 15
751
+ 8
752
+ 146
753
+ 49
754
+ 3
755
+ 0
756
+ 47
757
+ 49
758
+ 5
759
+ 1
760
+ 15
761
+ 8
762
+ 180
763
+ 45
764
+ 8
765
+ 13
766
+ 13
767
+ 71
768
+ 3
769
+ 47
770
+ 9
771
+ 174
772
+ 47
773
+ 49
774
+ 4
775
+ 0
776
+ 13
777
+ 47
778
+ 49
779
+ 5
780
+ 0
781
+ 15
782
+ 8
783
+ 177
784
+ 49
785
+ 3
786
+ 0
787
+ 49
788
+ 3
789
+ 1
790
+ 19
791
+ 2
792
+ 15
793
+ 20
794
+ 0
795
+ 20
796
+ 1
797
+ 49
798
+ 14
799
+ 1
800
+ 15
801
+ 20
802
+ 0
803
+ 20
804
+ 2
805
+ 49
806
+ 14
807
+ 1
808
+ 15
809
+ 5
810
+ 20
811
+ 1
812
+ 20
813
+ 0
814
+ 49
815
+ 15
816
+ 0
817
+ 47
818
+ 49
819
+ 16
820
+ 2
821
+ 15
822
+ 5
823
+ 20
824
+ 2
825
+ 20
826
+ 0
827
+ 49
828
+ 15
829
+ 0
830
+ 47
831
+ 49
832
+ 16
833
+ 2
834
+ 15
835
+ 5
836
+ 20
837
+ 0
838
+ 49
839
+ 15
840
+ 0
841
+ 47
842
+ 49
843
+ 17
844
+ 1
845
+ 11
846
+ I
847
+ 7
848
+ I
849
+ 3
850
+ I
851
+ 0
852
+ I
853
+ 0
854
+ n
855
+ p
856
+ 18
857
+ x
858
+ 3
859
+ Ref
860
+ n
861
+ x
862
+ 14
863
+ ReferenceQueue
864
+ x
865
+ 3
866
+ new
867
+ x
868
+ 8
869
+ allocate
870
+ x
871
+ 10
872
+ initialize
873
+ n
874
+ x
875
+ 13
876
+ WeakReference
877
+ x
878
+ 6
879
+ Object
880
+ n
881
+ n
882
+ n
883
+ n
884
+ n
885
+ x
886
+ 4
887
+ push
888
+ x
889
+ 5
890
+ shift
891
+ x
892
+ 12
893
+ assert_equal
894
+ x
895
+ 10
896
+ assert_nil
897
+ p
898
+ 19
899
+ I
900
+ -1
901
+ I
902
+ 11
903
+ I
904
+ 0
905
+ I
906
+ 12
907
+ I
908
+ 1d
909
+ I
910
+ 13
911
+ I
912
+ 6a
913
+ I
914
+ 14
915
+ I
916
+ b7
917
+ I
918
+ 15
919
+ I
920
+ bf
921
+ I
922
+ 16
923
+ I
924
+ c7
925
+ I
926
+ 17
927
+ I
928
+ d4
929
+ I
930
+ 18
931
+ I
932
+ e1
933
+ I
934
+ 19
935
+ I
936
+ ec
937
+ x
938
+ 60
939
+ /Users/bdurand/dev/projects/ref/test/reference_queue_test.rb
940
+ p
941
+ 3
942
+ x
943
+ 5
944
+ queue
945
+ x
946
+ 5
947
+ ref_1
948
+ x
949
+ 5
950
+ ref_2
951
+ x
952
+ 37
953
+ test_can_remove_references_as_a_stack
954
+ M
955
+ 1
956
+ n
957
+ n
958
+ x
959
+ 37
960
+ test_can_remove_references_as_a_stack
961
+ i
962
+ 236
963
+ 45
964
+ 0
965
+ 1
966
+ 43
967
+ 2
968
+ 13
969
+ 71
970
+ 3
971
+ 47
972
+ 9
973
+ 23
974
+ 47
975
+ 49
976
+ 4
977
+ 0
978
+ 13
979
+ 47
980
+ 49
981
+ 5
982
+ 0
983
+ 15
984
+ 8
985
+ 26
986
+ 49
987
+ 3
988
+ 0
989
+ 19
990
+ 0
991
+ 15
992
+ 45
993
+ 0
994
+ 6
995
+ 43
996
+ 7
997
+ 13
998
+ 71
999
+ 3
1000
+ 47
1001
+ 9
1002
+ 76
1003
+ 47
1004
+ 49
1005
+ 4
1006
+ 0
1007
+ 13
1008
+ 45
1009
+ 8
1010
+ 9
1011
+ 13
1012
+ 71
1013
+ 3
1014
+ 47
1015
+ 9
1016
+ 66
1017
+ 47
1018
+ 49
1019
+ 4
1020
+ 0
1021
+ 13
1022
+ 47
1023
+ 49
1024
+ 5
1025
+ 0
1026
+ 15
1027
+ 8
1028
+ 69
1029
+ 49
1030
+ 3
1031
+ 0
1032
+ 47
1033
+ 49
1034
+ 5
1035
+ 1
1036
+ 15
1037
+ 8
1038
+ 103
1039
+ 45
1040
+ 8
1041
+ 10
1042
+ 13
1043
+ 71
1044
+ 3
1045
+ 47
1046
+ 9
1047
+ 97
1048
+ 47
1049
+ 49
1050
+ 4
1051
+ 0
1052
+ 13
1053
+ 47
1054
+ 49
1055
+ 5
1056
+ 0
1057
+ 15
1058
+ 8
1059
+ 100
1060
+ 49
1061
+ 3
1062
+ 0
1063
+ 49
1064
+ 3
1065
+ 1
1066
+ 19
1067
+ 1
1068
+ 15
1069
+ 45
1070
+ 0
1071
+ 11
1072
+ 43
1073
+ 7
1074
+ 13
1075
+ 71
1076
+ 3
1077
+ 47
1078
+ 9
1079
+ 153
1080
+ 47
1081
+ 49
1082
+ 4
1083
+ 0
1084
+ 13
1085
+ 45
1086
+ 8
1087
+ 12
1088
+ 13
1089
+ 71
1090
+ 3
1091
+ 47
1092
+ 9
1093
+ 143
1094
+ 47
1095
+ 49
1096
+ 4
1097
+ 0
1098
+ 13
1099
+ 47
1100
+ 49
1101
+ 5
1102
+ 0
1103
+ 15
1104
+ 8
1105
+ 146
1106
+ 49
1107
+ 3
1108
+ 0
1109
+ 47
1110
+ 49
1111
+ 5
1112
+ 1
1113
+ 15
1114
+ 8
1115
+ 180
1116
+ 45
1117
+ 8
1118
+ 13
1119
+ 13
1120
+ 71
1121
+ 3
1122
+ 47
1123
+ 9
1124
+ 174
1125
+ 47
1126
+ 49
1127
+ 4
1128
+ 0
1129
+ 13
1130
+ 47
1131
+ 49
1132
+ 5
1133
+ 0
1134
+ 15
1135
+ 8
1136
+ 177
1137
+ 49
1138
+ 3
1139
+ 0
1140
+ 49
1141
+ 3
1142
+ 1
1143
+ 19
1144
+ 2
1145
+ 15
1146
+ 20
1147
+ 0
1148
+ 20
1149
+ 1
1150
+ 49
1151
+ 14
1152
+ 1
1153
+ 15
1154
+ 20
1155
+ 0
1156
+ 20
1157
+ 2
1158
+ 49
1159
+ 14
1160
+ 1
1161
+ 15
1162
+ 5
1163
+ 20
1164
+ 2
1165
+ 20
1166
+ 0
1167
+ 49
1168
+ 15
1169
+ 0
1170
+ 47
1171
+ 49
1172
+ 16
1173
+ 2
1174
+ 15
1175
+ 5
1176
+ 20
1177
+ 1
1178
+ 20
1179
+ 0
1180
+ 49
1181
+ 15
1182
+ 0
1183
+ 47
1184
+ 49
1185
+ 16
1186
+ 2
1187
+ 15
1188
+ 5
1189
+ 20
1190
+ 0
1191
+ 49
1192
+ 15
1193
+ 0
1194
+ 47
1195
+ 49
1196
+ 17
1197
+ 1
1198
+ 11
1199
+ I
1200
+ 7
1201
+ I
1202
+ 3
1203
+ I
1204
+ 0
1205
+ I
1206
+ 0
1207
+ n
1208
+ p
1209
+ 18
1210
+ x
1211
+ 3
1212
+ Ref
1213
+ n
1214
+ x
1215
+ 14
1216
+ ReferenceQueue
1217
+ x
1218
+ 3
1219
+ new
1220
+ x
1221
+ 8
1222
+ allocate
1223
+ x
1224
+ 10
1225
+ initialize
1226
+ n
1227
+ x
1228
+ 13
1229
+ WeakReference
1230
+ x
1231
+ 6
1232
+ Object
1233
+ n
1234
+ n
1235
+ n
1236
+ n
1237
+ n
1238
+ x
1239
+ 4
1240
+ push
1241
+ x
1242
+ 3
1243
+ pop
1244
+ x
1245
+ 12
1246
+ assert_equal
1247
+ x
1248
+ 10
1249
+ assert_nil
1250
+ p
1251
+ 19
1252
+ I
1253
+ -1
1254
+ I
1255
+ 1c
1256
+ I
1257
+ 0
1258
+ I
1259
+ 1d
1260
+ I
1261
+ 1d
1262
+ I
1263
+ 1e
1264
+ I
1265
+ 6a
1266
+ I
1267
+ 1f
1268
+ I
1269
+ b7
1270
+ I
1271
+ 20
1272
+ I
1273
+ bf
1274
+ I
1275
+ 21
1276
+ I
1277
+ c7
1278
+ I
1279
+ 22
1280
+ I
1281
+ d4
1282
+ I
1283
+ 23
1284
+ I
1285
+ e1
1286
+ I
1287
+ 24
1288
+ I
1289
+ ec
1290
+ x
1291
+ 60
1292
+ /Users/bdurand/dev/projects/ref/test/reference_queue_test.rb
1293
+ p
1294
+ 3
1295
+ x
1296
+ 5
1297
+ queue
1298
+ x
1299
+ 5
1300
+ ref_1
1301
+ x
1302
+ 5
1303
+ ref_2
1304
+ x
1305
+ 60
1306
+ test_references_are_added_when_the_object_has_been_collected
1307
+ M
1308
+ 1
1309
+ n
1310
+ n
1311
+ x
1312
+ 60
1313
+ test_references_are_added_when_the_object_has_been_collected
1314
+ i
1315
+ 11
1316
+ 45
1317
+ 0
1318
+ 1
1319
+ 43
1320
+ 2
1321
+ 56
1322
+ 3
1323
+ 50
1324
+ 4
1325
+ 0
1326
+ 11
1327
+ I
1328
+ 2
1329
+ I
1330
+ 0
1331
+ I
1332
+ 0
1333
+ I
1334
+ 0
1335
+ n
1336
+ p
1337
+ 5
1338
+ x
1339
+ 3
1340
+ Ref
1341
+ n
1342
+ x
1343
+ 4
1344
+ Mock
1345
+ M
1346
+ 1
1347
+ p
1348
+ 2
1349
+ x
1350
+ 9
1351
+ for_block
1352
+ t
1353
+ n
1354
+ x
1355
+ 60
1356
+ test_references_are_added_when_the_object_has_been_collected
1357
+ i
1358
+ 132
1359
+ 45
1360
+ 0
1361
+ 1
1362
+ 13
1363
+ 71
1364
+ 2
1365
+ 47
1366
+ 9
1367
+ 21
1368
+ 47
1369
+ 49
1370
+ 3
1371
+ 0
1372
+ 13
1373
+ 47
1374
+ 49
1375
+ 4
1376
+ 0
1377
+ 15
1378
+ 8
1379
+ 24
1380
+ 49
1381
+ 2
1382
+ 0
1383
+ 19
1384
+ 0
1385
+ 15
1386
+ 45
1387
+ 5
1388
+ 6
1389
+ 43
1390
+ 7
1391
+ 13
1392
+ 71
1393
+ 2
1394
+ 47
1395
+ 9
1396
+ 52
1397
+ 47
1398
+ 49
1399
+ 3
1400
+ 0
1401
+ 13
1402
+ 20
1403
+ 0
1404
+ 47
1405
+ 49
1406
+ 4
1407
+ 1
1408
+ 15
1409
+ 8
1410
+ 57
1411
+ 20
1412
+ 0
1413
+ 49
1414
+ 2
1415
+ 1
1416
+ 19
1417
+ 1
1418
+ 15
1419
+ 45
1420
+ 5
1421
+ 8
1422
+ 43
1423
+ 9
1424
+ 13
1425
+ 71
1426
+ 2
1427
+ 47
1428
+ 9
1429
+ 83
1430
+ 47
1431
+ 49
1432
+ 3
1433
+ 0
1434
+ 13
1435
+ 47
1436
+ 49
1437
+ 4
1438
+ 0
1439
+ 15
1440
+ 8
1441
+ 86
1442
+ 49
1443
+ 2
1444
+ 0
1445
+ 19
1446
+ 2
1447
+ 15
1448
+ 20
1449
+ 2
1450
+ 20
1451
+ 1
1452
+ 49
1453
+ 10
1454
+ 1
1455
+ 15
1456
+ 5
1457
+ 20
1458
+ 2
1459
+ 49
1460
+ 11
1461
+ 0
1462
+ 47
1463
+ 49
1464
+ 12
1465
+ 1
1466
+ 15
1467
+ 45
1468
+ 5
1469
+ 13
1470
+ 43
1471
+ 14
1472
+ 20
1473
+ 0
1474
+ 49
1475
+ 15
1476
+ 1
1477
+ 15
1478
+ 5
1479
+ 20
1480
+ 1
1481
+ 20
1482
+ 2
1483
+ 49
1484
+ 11
1485
+ 0
1486
+ 47
1487
+ 49
1488
+ 16
1489
+ 2
1490
+ 11
1491
+ I
1492
+ 7
1493
+ I
1494
+ 3
1495
+ I
1496
+ 0
1497
+ I
1498
+ 0
1499
+ I
1500
+ -2
1501
+ p
1502
+ 17
1503
+ x
1504
+ 6
1505
+ Object
1506
+ n
1507
+ x
1508
+ 3
1509
+ new
1510
+ x
1511
+ 8
1512
+ allocate
1513
+ x
1514
+ 10
1515
+ initialize
1516
+ x
1517
+ 3
1518
+ Ref
1519
+ n
1520
+ x
1521
+ 13
1522
+ WeakReference
1523
+ n
1524
+ x
1525
+ 14
1526
+ ReferenceQueue
1527
+ x
1528
+ 7
1529
+ monitor
1530
+ x
1531
+ 5
1532
+ shift
1533
+ x
1534
+ 10
1535
+ assert_nil
1536
+ n
1537
+ x
1538
+ 4
1539
+ Mock
1540
+ x
1541
+ 2
1542
+ gc
1543
+ x
1544
+ 12
1545
+ assert_equal
1546
+ p
1547
+ 15
1548
+ I
1549
+ 0
1550
+ I
1551
+ 29
1552
+ I
1553
+ 1b
1554
+ I
1555
+ 2a
1556
+ I
1557
+ 3c
1558
+ I
1559
+ 2b
1560
+ I
1561
+ 59
1562
+ I
1563
+ 2c
1564
+ I
1565
+ 61
1566
+ I
1567
+ 2d
1568
+ I
1569
+ 6c
1570
+ I
1571
+ 2e
1572
+ I
1573
+ 77
1574
+ I
1575
+ 2f
1576
+ I
1577
+ 84
1578
+ x
1579
+ 60
1580
+ /Users/bdurand/dev/projects/ref/test/reference_queue_test.rb
1581
+ p
1582
+ 3
1583
+ x
1584
+ 3
1585
+ obj
1586
+ x
1587
+ 3
1588
+ ref
1589
+ x
1590
+ 5
1591
+ queue
1592
+ x
1593
+ 3
1594
+ use
1595
+ p
1596
+ 5
1597
+ I
1598
+ -1
1599
+ I
1600
+ 27
1601
+ I
1602
+ 0
1603
+ I
1604
+ 28
1605
+ I
1606
+ b
1607
+ x
1608
+ 60
1609
+ /Users/bdurand/dev/projects/ref/test/reference_queue_test.rb
1610
+ p
1611
+ 0
1612
+ x
1613
+ 70
1614
+ test_references_are_added_immediately_if_the_object_has_been_collected
1615
+ M
1616
+ 1
1617
+ n
1618
+ n
1619
+ x
1620
+ 70
1621
+ test_references_are_added_immediately_if_the_object_has_been_collected
1622
+ i
1623
+ 11
1624
+ 45
1625
+ 0
1626
+ 1
1627
+ 43
1628
+ 2
1629
+ 56
1630
+ 3
1631
+ 50
1632
+ 4
1633
+ 0
1634
+ 11
1635
+ I
1636
+ 2
1637
+ I
1638
+ 0
1639
+ I
1640
+ 0
1641
+ I
1642
+ 0
1643
+ n
1644
+ p
1645
+ 5
1646
+ x
1647
+ 3
1648
+ Ref
1649
+ n
1650
+ x
1651
+ 4
1652
+ Mock
1653
+ M
1654
+ 1
1655
+ p
1656
+ 2
1657
+ x
1658
+ 9
1659
+ for_block
1660
+ t
1661
+ n
1662
+ x
1663
+ 70
1664
+ test_references_are_added_immediately_if_the_object_has_been_collected
1665
+ i
1666
+ 121
1667
+ 45
1668
+ 0
1669
+ 1
1670
+ 13
1671
+ 71
1672
+ 2
1673
+ 47
1674
+ 9
1675
+ 21
1676
+ 47
1677
+ 49
1678
+ 3
1679
+ 0
1680
+ 13
1681
+ 47
1682
+ 49
1683
+ 4
1684
+ 0
1685
+ 15
1686
+ 8
1687
+ 24
1688
+ 49
1689
+ 2
1690
+ 0
1691
+ 19
1692
+ 0
1693
+ 15
1694
+ 45
1695
+ 5
1696
+ 6
1697
+ 43
1698
+ 7
1699
+ 13
1700
+ 71
1701
+ 2
1702
+ 47
1703
+ 9
1704
+ 52
1705
+ 47
1706
+ 49
1707
+ 3
1708
+ 0
1709
+ 13
1710
+ 20
1711
+ 0
1712
+ 47
1713
+ 49
1714
+ 4
1715
+ 1
1716
+ 15
1717
+ 8
1718
+ 57
1719
+ 20
1720
+ 0
1721
+ 49
1722
+ 2
1723
+ 1
1724
+ 19
1725
+ 1
1726
+ 15
1727
+ 45
1728
+ 5
1729
+ 8
1730
+ 43
1731
+ 9
1732
+ 20
1733
+ 0
1734
+ 49
1735
+ 10
1736
+ 1
1737
+ 15
1738
+ 45
1739
+ 5
1740
+ 11
1741
+ 43
1742
+ 12
1743
+ 13
1744
+ 71
1745
+ 2
1746
+ 47
1747
+ 9
1748
+ 94
1749
+ 47
1750
+ 49
1751
+ 3
1752
+ 0
1753
+ 13
1754
+ 47
1755
+ 49
1756
+ 4
1757
+ 0
1758
+ 15
1759
+ 8
1760
+ 97
1761
+ 49
1762
+ 2
1763
+ 0
1764
+ 19
1765
+ 2
1766
+ 15
1767
+ 20
1768
+ 2
1769
+ 20
1770
+ 1
1771
+ 49
1772
+ 13
1773
+ 1
1774
+ 15
1775
+ 5
1776
+ 20
1777
+ 1
1778
+ 20
1779
+ 2
1780
+ 49
1781
+ 14
1782
+ 0
1783
+ 47
1784
+ 49
1785
+ 15
1786
+ 2
1787
+ 11
1788
+ I
1789
+ 7
1790
+ I
1791
+ 3
1792
+ I
1793
+ 0
1794
+ I
1795
+ 0
1796
+ I
1797
+ -2
1798
+ p
1799
+ 16
1800
+ x
1801
+ 6
1802
+ Object
1803
+ n
1804
+ x
1805
+ 3
1806
+ new
1807
+ x
1808
+ 8
1809
+ allocate
1810
+ x
1811
+ 10
1812
+ initialize
1813
+ x
1814
+ 3
1815
+ Ref
1816
+ n
1817
+ x
1818
+ 13
1819
+ WeakReference
1820
+ n
1821
+ x
1822
+ 4
1823
+ Mock
1824
+ x
1825
+ 2
1826
+ gc
1827
+ n
1828
+ x
1829
+ 14
1830
+ ReferenceQueue
1831
+ x
1832
+ 7
1833
+ monitor
1834
+ x
1835
+ 5
1836
+ shift
1837
+ x
1838
+ 12
1839
+ assert_equal
1840
+ p
1841
+ 13
1842
+ I
1843
+ 0
1844
+ I
1845
+ 35
1846
+ I
1847
+ 1b
1848
+ I
1849
+ 36
1850
+ I
1851
+ 3c
1852
+ I
1853
+ 37
1854
+ I
1855
+ 47
1856
+ I
1857
+ 38
1858
+ I
1859
+ 64
1860
+ I
1861
+ 39
1862
+ I
1863
+ 6c
1864
+ I
1865
+ 3a
1866
+ I
1867
+ 79
1868
+ x
1869
+ 60
1870
+ /Users/bdurand/dev/projects/ref/test/reference_queue_test.rb
1871
+ p
1872
+ 3
1873
+ x
1874
+ 3
1875
+ obj
1876
+ x
1877
+ 3
1878
+ ref
1879
+ x
1880
+ 5
1881
+ queue
1882
+ x
1883
+ 3
1884
+ use
1885
+ p
1886
+ 5
1887
+ I
1888
+ -1
1889
+ I
1890
+ 33
1891
+ I
1892
+ 0
1893
+ I
1894
+ 34
1895
+ I
1896
+ b
1897
+ x
1898
+ 60
1899
+ /Users/bdurand/dev/projects/ref/test/reference_queue_test.rb
1900
+ p
1901
+ 0
1902
+ p
1903
+ 11
1904
+ I
1905
+ 2
1906
+ I
1907
+ 5
1908
+ I
1909
+ 10
1910
+ I
1911
+ 11
1912
+ I
1913
+ 1e
1914
+ I
1915
+ 1c
1916
+ I
1917
+ 2c
1918
+ I
1919
+ 27
1920
+ I
1921
+ 3a
1922
+ I
1923
+ 33
1924
+ I
1925
+ 48
1926
+ x
1927
+ 60
1928
+ /Users/bdurand/dev/projects/ref/test/reference_queue_test.rb
1929
+ p
1930
+ 0
1931
+ x
1932
+ 13
1933
+ attach_method
1934
+ p
1935
+ 7
1936
+ I
1937
+ 0
1938
+ I
1939
+ 1
1940
+ I
1941
+ 9
1942
+ I
1943
+ 2
1944
+ I
1945
+ 1c
1946
+ I
1947
+ 4
1948
+ I
1949
+ 3f
1950
+ x
1951
+ 60
1952
+ /Users/bdurand/dev/projects/ref/test/reference_queue_test.rb
1953
+ p
1954
+ 0