RSSAmplifier

openmymind.net · Jul 30, 2026

std.Io.Writer.Allocating ate all my memory

0
Sign in to vote or save

This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.

If I told you that the following prints 1665 : var b: std.ArrayList(u8) = try .initCapacity(init.gpa, 1024); try b.appendSlice(init.gpa, "a" ** 1025); std.debug.print("{d} n", .{b.capacity}); Would you be able to guess what this prints? var w: Io.Writer.Allocating = try .initCapacity(init.gpa, 1024); try w.writer.writeAll("a" ** 1025); std.debug.print("{d} n", .{w.writer.buffer.len}); Like me, you…

Read on openmymind.net

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.