aboutsummaryrefslogtreecommitdiffstats
path: root/src/model.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-12-01 20:39:44 -0500
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:08 -0500
commit02d56e83931e53e1cde57247c64d56fda3804f77 (patch)
tree2d1ac467bc56f4f4f3570497427be32d7e36bd1a /src/model.c
parentd094448c095a59117febc8bd4687df071ce9759a (diff)
downloadserd-02d56e83931e53e1cde57247c64d56fda3804f77.tar.gz
serd-02d56e83931e53e1cde57247c64d56fda3804f77.tar.bz2
serd-02d56e83931e53e1cde57247c64d56fda3804f77.zip
[WIP] Tighten up reader node management
[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.
Diffstat (limited to 'src/model.c')
-rw-r--r--src/model.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/model.c b/src/model.c
index fd1b0f92..fb0fd940 100644
--- a/src/model.c
+++ b/src/model.c
@@ -15,6 +15,7 @@
#include "serd/statement.h"
#include "serd/status.h"
#include "zix/allocator.h"
+#include "zix/attributes.h"
#include "zix/btree.h"
#include "zix/status.h"
@@ -386,7 +387,7 @@ simple_order(const SerdStatementOrder order)
}
/// Return the best index scanning strategy for a pattern with given nodes
-static ScanStrategy
+ZIX_PURE_FUNC static ScanStrategy
serd_model_strategy(const SerdModel* const model,
const bool with_s,
const bool with_p,