damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 984c7b6932b89c3fe05b312e04775d145ae3fc56
parent 0bbc2c6348428fa43c830dac2eb22b328c9d8830
Author: William Casarin <jb55@jb55.com>
Date:   Sat, 26 Aug 2023 22:11:12 -0700

ndb: ensure profile flatbuffers are not copied

These are pointers into LMDB's virtual memory map of the database. No
copy required.

Diffstat:
Mnostrdb/Ndb.swift | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/nostrdb/Ndb.swift b/nostrdb/Ndb.swift @@ -44,7 +44,8 @@ class Ndb { return nil } - return NdbProfile(.init(memory: profile_p, count: size), o: 0) + let buf = ByteBuffer(assumingMemoryBound: profile_p, capacity: size) + return NdbProfile(buf, o: 0) } }