@@ -220,8 +220,6 @@ const OrderedCache = struct {
220
220
try self .cache .insert (idx , .{ .data = data });
221
221
}
222
222
223
- <<<<<<< HEAD :src / experimental / cpu_caching_allocator.zig
224
- ====== =
225
223
pub fn addToCache (
226
224
self : * Self ,
227
225
comptime T : type ,
@@ -243,7 +241,6 @@ const OrderedCache = struct {
243
241
}
244
242
};
245
243
246
- >>>>>>> 1d6af1ed59b8b6564b2d7b45f91f01222e2ea570 :src / experimental / linear_caching_allocator.zig
247
244
// I'm making a distinction for a CPU allocator because
248
245
// other devices can use the caching allocator as well.
249
246
@@ -581,11 +578,7 @@ test "LinearCachingAllocator: alignment" {
581
578
}
582
579
}
583
580
584
- <<<<<<< HEAD :src / experimental / cpu_caching_allocator.zig
585
- test "CPUCachingAllocator: resize" {
586
- ====== =
587
581
test "LinearCachingAllocator: resize" {
588
- >>>>>>> 1d6af1ed59b8b6564b2d7b45f91f01222e2ea570 :src / experimental / linear_caching_allocator.zig
589
582
590
583
// So testing resize is tough. Resizes can "fail"
591
584
// legitimately. That's why they return a bool and
@@ -618,19 +611,11 @@ test "LinearCachingAllocator: resize" {
618
611
x : usize = 0
619
612
};
620
613
621
- <<<<<<< HEAD :src / experimental / cpu_caching_allocator.zig
622
- var cpu_caching_allocator = CPUCachingAllocator { };
623
-
624
- defer cpu_caching_allocator .deinit ();
625
-
626
- var allocator = cpu_caching_allocator .allocator ();
627
- ====== =
628
614
var caching_allocator = LinearCachingAllocator { };
629
615
630
616
defer caching_allocator .deinit ();
631
617
632
618
var allocator = caching_allocator .allocator ();
633
- >>>>>>> 1d6af1ed59b8b6564b2d7b45f91f01222e2ea570 :src / experimental / linear_caching_allocator.zig
634
619
635
620
var PCG = rand .Pcg .init (42 );
636
621
var pcg = PCG .random ();
@@ -653,20 +638,12 @@ test "LinearCachingAllocator: resize" {
653
638
var check : []u8 = std .mem .sliceAsBytes (data );
654
639
655
640
// lookup memory in allocator cache...
656
- <<<<<<< HEAD :src / experimental / cpu_caching_allocator.zig
657
- var index = cpu_caching_allocator .buffer .locateMemory (check );
658
- ====== =
659
641
var index = caching_allocator .buffer .locateMemory (check );
660
- >>>>>>> 1d6af1ed59b8b6564b2d7b45f91f01222e2ea570 :src / experimental / linear_caching_allocator.zig
661
642
662
643
// null means we didn't find it.
663
644
try std .testing .expect (index != null );
664
645
665
- <<<<<<< HEAD :src / experimental / cpu_caching_allocator.zig
666
- var item = cpu_caching_allocator .buffer .itemData (index .? );
667
- ====== =
668
646
var item = caching_allocator .buffer .itemData (index .? );
669
- >>>>>>> 1d6af1ed59b8b6564b2d7b45f91f01222e2ea570 :src / experimental / linear_caching_allocator.zig
670
647
671
648
// ensure that it is the same data.
672
649
try std .testing .expect (@intFromPtr (check .ptr ) == @intFromPtr (item .ptr ));
@@ -677,11 +654,7 @@ test "LinearCachingAllocator: resize" {
677
654
678
655
{ // check that un-cached memory isn't "found".
679
656
var check : []u8 = std .mem .sliceAsBytes (data );
680
- <<<<<<< HEAD :src / experimental / cpu_caching_allocator.zig
681
- var index = cpu_caching_allocator .buffer .locateMemory (check );
682
- ====== =
683
657
var index = caching_allocator .buffer .locateMemory (check );
684
- >>>>>>> 1d6af1ed59b8b6564b2d7b45f91f01222e2ea570 :src / experimental / linear_caching_allocator.zig
685
658
try std .testing .expect (index == null );
686
659
}
687
660
@@ -690,14 +663,6 @@ test "LinearCachingAllocator: resize" {
690
663
691
664
{ // check that cached memory is found.
692
665
var check : []u8 = std .mem .sliceAsBytes (data );
693
- <<<<<<< HEAD :src / experimental / cpu_caching_allocator.zig
694
- var index = cpu_caching_allocator .buffer .locateMemory (check );
695
- try std .testing .expect (index != null );
696
- var item = cpu_caching_allocator .buffer .itemData (index .? );
697
- try std .testing .expect (@intFromPtr (check .ptr ) == @intFromPtr (item .ptr ));
698
- }
699
- }
700
- ====== =
701
666
var index = caching_allocator .buffer .locateMemory (check );
702
667
try std .testing .expect (index != null );
703
668
var item = caching_allocator .buffer .itemData (index .? );
@@ -738,4 +703,3 @@ test "LinearCachingAllocator: cache-warming" {
738
703
try std .testing .expectEqual (caching_allocator .buffer .itemSize (7 ), 400 * @bitSizeOf (TypeA ) / @bitSizeOf (u8 ));
739
704
try std .testing .expectEqual (caching_allocator .buffer .itemSize (9 ), 500 * @bitSizeOf (TypeA ) / @bitSizeOf (u8 ));
740
705
}
741
- >>>>>>> 1d6af1ed59b8b6564b2d7b45f91f01222e2ea570 :src / experimental / linear_caching_allocator.zig
0 commit comments