@@ -1678,7 +1678,7 @@ test "SHA-256 packfile indexing and checkout" {
1678
1678
/// Checks out a commit of a packfile. Intended for experimenting with and
1679
1679
/// benchmarking possible optimizations to the indexing and checkout behavior.
1680
1680
pub fn main () ! void {
1681
- const allocator = std .heap .c_allocator ;
1681
+ const allocator = std .heap .smp_allocator ;
1682
1682
1683
1683
const args = try std .process .argsAlloc (allocator );
1684
1684
defer std .process .argsFree (allocator , args );
@@ -1703,12 +1703,14 @@ pub fn main() !void {
1703
1703
std .debug .print ("Starting index...\n " , .{});
1704
1704
var index_file = try git_dir .createFile ("idx" , .{ .read = true });
1705
1705
defer index_file .close ();
1706
- var index_buffered_writer = std . io . bufferedWriter ( index_file . deprecatedWriter ()) ;
1707
- try indexPack ( allocator , format , & pack_file_reader , index_buffered_writer .writer () );
1708
- try index_buffered_writer . flush ( );
1706
+ var index_file_buffer : [ 4096 ] u8 = undefined ;
1707
+ var index_file_writer = index_file .writer (& index_file_buffer );
1708
+ try indexPack ( allocator , format , & pack_file_reader , & index_file_writer );
1709
1709
1710
1710
std .debug .print ("Starting checkout...\n " , .{});
1711
- var repository = try Repository .init (allocator , format , & pack_file_reader , index_file );
1711
+ var index_file_reader = index_file .reader (& index_file_buffer );
1712
+ var repository : Repository = undefined ;
1713
+ try repository .init (allocator , format , & pack_file_reader , & index_file_reader );
1712
1714
defer repository .deinit ();
1713
1715
var diagnostics : Diagnostics = .{ .allocator = allocator };
1714
1716
defer diagnostics .deinit ();
0 commit comments