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.
parent
c1e9993665
commit
7e35c28bc6
|
@ -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 ;
|
||||
|
|
Loading…
Reference in New Issue