authorgravatar for quae@daurnimator.comdaurnimator <quae@daurnimator.com> 2019-11-11 01:25:38+11:00
committergravatar for quae@daurnimator.comdaurnimator <quae@daurnimator.com> 2019-11-25 09:26:33+11:00
log6037f892125fc87996450f3f985b0d2eb38765c0
tree7b37eb6dda269c651f932715d4b2c94d4029ed1d
parentcd749e04161a1a3899ed0a723a5cde444159900e
signaturelock-open Commit is signed but in an unrecognized format.

std: fifo rename from FixedSizeFifo to LinearFifo


1 files changed, 8 insertions(+), 8 deletions(-)

lib/std/fifo.zig+8-8
......@@ -9,7 +9,7 @@ const debug = std.debug;
99const assert = debug.assert;
1010const testing = std.testing;
1111
12pub const FifoBufferType = union(enum) {
12pub const LinearFifoBufferType = union(enum) {
1313 /// The buffer is internal to the fifo; it is of the specified size.
1414 Static: usize,
1515
......@@ -20,9 +20,9 @@ pub const FifoBufferType = union(enum) {
2020 Dynamic,
2121};
2222
23pub fn FixedSizeFifo(
23pub fn LinearFifo(
2424 comptime T: type,
25 comptime buffer_type: FifoBufferType,
25 comptime buffer_type: LinearFifoBufferType,
2626) type {
2727 const autoalign = false;
2828
......@@ -332,8 +332,8 @@ pub fn FixedSizeFifo(
332332 };
333333}
334334
335test "FixedSizeFifo(u8, .Dynamic)" {
336 var fifo = FixedSizeFifo(u8, .Dynamic).init(debug.global_allocator);
335test "LinearFifo(u8, .Dynamic)" {
336 var fifo = LinearFifo(u8, .Dynamic).init(debug.global_allocator);
337337 defer fifo.deinit();
338338
339339 try fifo.write("HELLO");
......@@ -397,10 +397,10 @@ test "FixedSizeFifo(u8, .Dynamic)" {
397397 }
398398}
399399
400test "FixedSizeFifo" {
400test "LinearFifo" {
401401 inline for ([_]type{ u1, u8, u16, u64 }) |T| {
402 inline for ([_]FifoBufferType{ FifoBufferType{ .Static = 32 }, .Slice, .Dynamic }) |bt| {
403 const FifoType = FixedSizeFifo(T, bt);
402 inline for ([_]LinearFifoBufferType{ LinearFifoBufferType{ .Static = 32 }, .Slice, .Dynamic }) |bt| {
403 const FifoType = LinearFifo(T, bt);
404404 var buf: if (bt == .Slice) [32]T else void = undefined;
405405 var fifo = switch (bt) {
406406 .Static => FifoType.init(),