serenity
serenity copied to clipboard
Everywhere: Some Core::File -> Core::Stream::File conversions
These are some simpler cases, because I was in the mood for simple.
A few of these are reading into a byte buffer a-la ByteBuffer::create_uninitialized, but of a static size. Can we use e.g. Array<u8, 4096> instead to avoid extra allocation? See: https://github.com/SerenityOS/serenity/blob/master/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GeneratorUtil.h#L337 for an example
A few of these are reading into a byte buffer a-la
ByteBuffer::create_uninitialized, but of a static size. Can we use e.g.Array<u8, 4096>instead to avoid extra allocation? See:master/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GeneratorUtil.h#L337 for an example
Hmmm. That doesn't handle OOM for allocating the array though, right?
Hmmm. That doesn't handle OOM for allocating the array though, right?
Arrays aren't heap allocated
Ohhh, so we don't need to worry about OOM for stack allocation? That makes sense.
I've replaced use of ByteBuffer::create_uninitialized() with an Array<>. Also, using PAGE_SIZE instead of 4096 as suggested in another PR.