@@ -500,7 +500,7 @@ mod tests {
500
500
501
501
#[ test]
502
502
pub fn test_unused ( ) {
503
- let arena: TypedArena < Point > = TypedArena :: new ( ) ;
503
+ let arena: TypedArena < Point > = TypedArena :: default ( ) ;
504
504
assert ! ( arena. chunks. borrow( ) . is_empty( ) ) ;
505
505
}
506
506
@@ -538,7 +538,7 @@ mod tests {
538
538
}
539
539
}
540
540
541
- let arena = Wrap ( TypedArena :: new ( ) ) ;
541
+ let arena = Wrap ( TypedArena :: default ( ) ) ;
542
542
543
543
let result = arena. alloc_outer ( || Outer {
544
544
inner : arena. alloc_inner ( || Inner { value : 10 } ) ,
@@ -549,15 +549,15 @@ mod tests {
549
549
550
550
#[ test]
551
551
pub fn test_copy ( ) {
552
- let arena = TypedArena :: new ( ) ;
552
+ let arena = TypedArena :: default ( ) ;
553
553
for _ in 0 ..100000 {
554
554
arena. alloc ( Point { x : 1 , y : 2 , z : 3 } ) ;
555
555
}
556
556
}
557
557
558
558
#[ bench]
559
559
pub fn bench_copy ( b : & mut Bencher ) {
560
- let arena = TypedArena :: new ( ) ;
560
+ let arena = TypedArena :: default ( ) ;
561
561
b. iter ( || arena. alloc ( Point { x : 1 , y : 2 , z : 3 } ) )
562
562
}
563
563
@@ -576,7 +576,7 @@ mod tests {
576
576
577
577
#[ test]
578
578
pub fn test_noncopy ( ) {
579
- let arena = TypedArena :: new ( ) ;
579
+ let arena = TypedArena :: default ( ) ;
580
580
for _ in 0 ..100000 {
581
581
arena. alloc ( Noncopy {
582
582
string : "hello world" . to_string ( ) ,
@@ -587,15 +587,15 @@ mod tests {
587
587
588
588
#[ test]
589
589
pub fn test_typed_arena_zero_sized ( ) {
590
- let arena = TypedArena :: new ( ) ;
590
+ let arena = TypedArena :: default ( ) ;
591
591
for _ in 0 ..100000 {
592
592
arena. alloc ( ( ) ) ;
593
593
}
594
594
}
595
595
596
596
#[ test]
597
597
pub fn test_typed_arena_clear ( ) {
598
- let mut arena = TypedArena :: new ( ) ;
598
+ let mut arena = TypedArena :: default ( ) ;
599
599
for _ in 0 ..10 {
600
600
arena. clear ( ) ;
601
601
for _ in 0 ..10000 {
@@ -620,7 +620,7 @@ mod tests {
620
620
fn test_typed_arena_drop_count ( ) {
621
621
let counter = Cell :: new ( 0 ) ;
622
622
{
623
- let arena: TypedArena < DropCounter > = TypedArena :: new ( ) ;
623
+ let arena: TypedArena < DropCounter > = TypedArena :: default ( ) ;
624
624
for _ in 0 ..100 {
625
625
// Allocate something with drop glue to make sure it doesn't leak.
626
626
arena. alloc ( DropCounter { count : & counter } ) ;
@@ -632,7 +632,7 @@ mod tests {
632
632
#[ test]
633
633
fn test_typed_arena_drop_on_clear ( ) {
634
634
let counter = Cell :: new ( 0 ) ;
635
- let mut arena: TypedArena < DropCounter > = TypedArena :: new ( ) ;
635
+ let mut arena: TypedArena < DropCounter > = TypedArena :: default ( ) ;
636
636
for i in 0 ..10 {
637
637
for _ in 0 ..100 {
638
638
// Allocate something with drop glue to make sure it doesn't leak.
@@ -659,7 +659,7 @@ mod tests {
659
659
fn test_typed_arena_drop_small_count ( ) {
660
660
DROP_COUNTER . with ( |c| c. set ( 0 ) ) ;
661
661
{
662
- let arena: TypedArena < SmallDroppable > = TypedArena :: new ( ) ;
662
+ let arena: TypedArena < SmallDroppable > = TypedArena :: default ( ) ;
663
663
for _ in 0 ..100 {
664
664
// Allocate something with drop glue to make sure it doesn't leak.
665
665
arena. alloc ( SmallDroppable ) ;
@@ -671,7 +671,7 @@ mod tests {
671
671
672
672
#[ bench]
673
673
pub fn bench_noncopy ( b : & mut Bencher ) {
674
- let arena = TypedArena :: new ( ) ;
674
+ let arena = TypedArena :: default ( ) ;
675
675
b. iter ( || {
676
676
arena. alloc ( Noncopy {
677
677
string : "hello world" . to_string ( ) ,
0 commit comments