|
@@ -29,9 +29,6 @@ struct graph_iter_t {
|
|
|
inline static LSUP_rc
|
|
|
graph_iter_next_buffer (LSUP_GraphIterator *it);
|
|
|
|
|
|
-inline static LSUP_rc
|
|
|
-graph_iter_alloc_buffers (LSUP_GraphIterator *it);
|
|
|
-
|
|
|
|
|
|
#define ENTRY(a, b) (be) == (LSUP_STORE_##a) ||
|
|
|
static inline bool
|
|
@@ -456,7 +453,15 @@ LSUP_graph_lookup_txn (
|
|
|
}
|
|
|
|
|
|
it->graph = gr;
|
|
|
- RCNL (graph_iter_alloc_buffers (it));
|
|
|
+
|
|
|
+ if (it->graph->store->sif->features & LSUP_STORE_COW) {
|
|
|
+ // Copy-on-wite store.
|
|
|
+ it->sspo = BTRP_DUMMY;
|
|
|
+
|
|
|
+ if (UNLIKELY (it->sspo == NULL)) return NULL;
|
|
|
+ } else {
|
|
|
+ // TODO copy-on-retrieval store. No implementations yet.
|
|
|
+ }
|
|
|
|
|
|
return it;
|
|
|
}
|
|
@@ -497,6 +502,7 @@ LSUP_graph_iter_free (LSUP_GraphIterator *it)
|
|
|
*/
|
|
|
if (it->graph->store->sif->features & LSUP_STORE_COW) {
|
|
|
LSUP_btriple_free_shallow (it->sspo);
|
|
|
+ log_debug ("Freeing dummy triple @ %p", it->sspo);
|
|
|
} else {
|
|
|
// TODO copy-on-retrieval stores. None yet.
|
|
|
}
|
|
@@ -715,23 +721,6 @@ graph_iter_next_buffer (LSUP_GraphIterator *it)
|
|
|
{ return it->graph->store->sif->lu_next_fn (it->data, it->sspo, NULL); }
|
|
|
|
|
|
|
|
|
-/** @brief Properly allocate temporary byte buffers in advance of iteration.
|
|
|
- */
|
|
|
-inline LSUP_rc
|
|
|
-graph_iter_alloc_buffers (LSUP_GraphIterator *it)
|
|
|
-{
|
|
|
- if (it->graph->store->sif->features & LSUP_STORE_COW) {
|
|
|
- // Copy-on-wite store.
|
|
|
- it->sspo = BTRP_DUMMY;
|
|
|
- if (it->sspo == NULL) return LSUP_MEM_ERR;
|
|
|
- } else {
|
|
|
- // TODO copy-on-retrieval store. No implementations yet.
|
|
|
- }
|
|
|
-
|
|
|
- return LSUP_OK;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* Extern inline definitions.
|
|
|
*/
|