summaryrefslogtreecommitdiff
path: root/Kernel/KBufferBuilder.h
AgeCommit message (Collapse)Author
2021-02-28Kernel: Use default con/de-structorsBen Wiederhake
This may seem like a no-op change, however it shrinks down the Kernel by a bit: .text -432 .unmap_after_init -60 .data -480 .debug_info -673 .debug_aranges 8 .debug_ranges -232 .debug_line -558 .debug_str -308 .debug_frame -40 With '= default', the compiler can do more inlining, hence the savings. I intentionally omitted some opportunities for '= default', because they would increase the Kernel size.
2021-02-23AK+Kernel+Userland: Enable some more compiletime format string checksAnotherTest
This enables format string checks for three more functions: - String::formatted() - Builder::appendff() - KBufferBuilder::appendff()
2021-02-09Kernel: Convert all *Builder::appendf() => appendff()Andreas Kling
2021-01-03Kernel: Improve ProcFS behavior in low memory conditionsTom
When ProcFS could no longer allocate KBuffer objects to serve calls to read, it would just return 0, indicating EOF. This then triggered parsing errors because code assumed it read the file. Because read isn't supposed to return ENOMEM, change ProcFS to populate the file data upon file open or seek to the beginning. This also means that calls to open can now return ENOMEM if needed. This allows the caller to either be able to successfully open the file and read it, or fail to open it in the first place.
2020-12-18Kernel: Move KBufferBuilder to the fallible KBuffer APIAndreas Kling
KBufferBuilder::build() now returns an OwnPtr<KBuffer> and can fail. Clients of the API have been updated to handle that situation.
2020-11-02AK+Kernel: Escape JSON keys & valuesAndreas Kling
Grab the escaping logic from JSON string value serialization and use it for serializing all keys and values. Fixes #3917.
2020-10-08Kernel: Add KBufferBuilder::appendff.asynts
Why does this class exist anyways? What is wrong with using StringBuilder?
2020-09-25Meta+Kernel: Make clang-format-10 cleanBen Wiederhake
2020-02-16Kernel: Move all code into the Kernel namespaceAndreas Kling
2020-01-18Meta: Add license header to source filesAndreas Kling
As suggested by Joshua, this commit adds the 2-clause BSD license as a comment block to the top of every source file. For the first pass, I've just added myself for simplicity. I encourage everyone to add themselves as copyright holders of any file they've added or modified in some significant way. If I've added myself in error somewhere, feel free to replace it with the appropriate copyright holder instead. Going forward, all new source files should include a license header.
2019-09-06AK: Rename <AK/AKString.h> to <AK/String.h>Andreas Kling
This was a workaround to be able to build on case-insensitive file systems where it might get confused about <string.h> vs <String.h>. Let's just not support building that way, so String.h can have an objectively nicer name. :^)
2019-08-06Kernel: Add KBufferBuilder, similar to StringBuilder but for KBufferAndreas Kling
This class works by eagerly allocating 1MB of virtual memory but only adding physical pages on demand. In other words, when you append to it, its memory usage will increase by 1 page whenever you append across a page boundary (4KB.)