Age | Commit message (Collapse) | Author | Files | Lines |
|
[WIP] Broken on 32-bit
This makes the reader stack manipulations stricter, to make the code more
regular and avoid redundant work and bad cache activity. Now, functions that
push node headers and their bodies are responsible for (more or less)
immediately pushing any trailing null bytes required for termination and
alignment.
This makes the writes to the node in the stack more local, ensures nodes are
terminated as early as possible (to reduce the risk of using non-terminated
strings), and avoids the need to calculate aligned stack allocations.
|
|
|
|
This makes it explicit in the API where memory is allocated, and allows the
user to provide a custom allocator to avoid the use of the default system
allocator for whatever reason.
|
|
|
|
|
|
|
|
Since all memory used by the reader is POD in the stack, there is no benefit to
forcing code to explicitly pop everything pushed to the stack, since any
function can record an offset and pop back down to it regardless of what its
callers pushed if it knows that it does not need those items.
This is slightly more efficient (due to avoiding many pop calls), but also more
resilient since "leaks" at deeper levels of recursion get nuked by some caller
regardless of what was pushed. This should help prevent future regressions
like f6437f606 (Fix memory consumption when reading documents).
|
|
|
|
The constant casting just makes user code a mess, for no benefit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This avoids some unnecessary type punning.
|
|
|