forestdb.lib: fdb_iterator_get() actually calls create_doc and mallocs the memory for you. We use fdb_doc_free to free() it in with-doc later.

db4
Doug Coleman 2014-12-11 15:28:13 -08:00
parent c1e9993665
commit 7e35c28bc6
1 changed files with 3 additions and 2 deletions

View File

@ -293,9 +293,10 @@ T{ doc
} cleave <info> ;
: fdb-iterator-get ( iterator -- doc/f )
fdb_doc malloc-struct fdb_doc <ref>
f void* <ref>
[ fdb_iterator_get check-iterate-result ] keep swap
[ void* deref fdb_doc memory>struct ] [ void* deref free f ] if ;
[ void* deref fdb_doc memory>struct ]
[ drop f ] if ;
: fdb-iterator-seek ( iterator key seek-opt -- )
[ dup length ] dip fdb_iterator_seek fdb-check-error ;