(pre-define dg-id-t b64 dg-ordinal-t b32 dg-id-max UINT64_MAX ;data can not be greater than lmdb max keysize, which is 511 by lmdb default but can be adjusted with recompiling lmdb dg-size-octets-data-max 511 dg-size-octets-data-min 1 dg-size-octets-id (sizeof dg-id-t) dg-size-octets-ordinal (sizeof dg-ordinal-t)) (pre-define (dg-id-equal? a b) (= a b)) (pre-define (dg-id-compare a b) (if* (< a b) -1 (> a b))) (pre-define (dg-pointer->id a index) (deref (+ index (convert-type a dg-id-t*))))