     kbytes length    :> key-size
     handle kbytes key-size sizeout tcadbget :> output
     output [
-        [ sizeout *int memory>byte-array ] [ tcfree ] bi bytes>object t
+        [ memory>object ] [ tcfree ] bi t
     ] [ f f ] if* ;
 
 M: tokyo-abstractdb assoc-size ( db -- size ) handle>> tcadbrnum ;

! Copyright (C) 2009 Bruno Deferrari
! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien.c-types arrays assocs destructors kernel libc locals
sequences serialize tokyo.alien.tcadb tokyo.alien.tcutil vectors ;
IN: tokyo.cabinet.abstract

TUPLE: tokyo-abstractdb handle disposed ;

INSTANCE: tokyo-abstractdb assoc


    db assoc-size <vector> :> keys
    handle tcadbiterinit drop
    [ handle size-out tcadbiternext dup ] [
        [ memory>object ] [ tcfree ] bi
        keys push
    ] while drop
    keys [ dup db at 2array ] { } map-as ;

