From c8594c69b612005c7507ad00f7274ca7791197d7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 28 Oct 2018 14:15:28 +0100 Subject: Cache commonly used nodes in the world --- include/serd/world.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/serd') diff --git a/include/serd/world.h b/include/serd/world.h index dc2b3b83..fb0930aa 100644 --- a/include/serd/world.h +++ b/include/serd/world.h @@ -7,6 +7,7 @@ #include "serd/attributes.h" #include "serd/memory.h" #include "serd/node.h" +#include "serd/nodes.h" #include "serd/status.h" #include "zix/attributes.h" @@ -67,6 +68,16 @@ serd_world_limits(const SerdWorld* ZIX_NONNULL world); SERD_API SerdStatus serd_world_set_limits(SerdWorld* ZIX_NONNULL world, SerdLimits limits); +/** + Return the nodes cache in `world`. + + The returned cache is owned by the world and contains various nodes used + frequently by the implementation. For convenience, it may be used to store + additional nodes which will be freed when the world is freed. +*/ +SERD_PURE_API SerdNodes* ZIX_NONNULL +serd_world_nodes(SerdWorld* ZIX_NONNULL world); + /** Return a unique blank node. -- cgit v1.2.1