1
0
mirror of git://jb55.com/damus synced 2024-09-16 02:03:45 +00:00

ndb: ensure profile flatbuffers are not copied

These are pointers into LMDB's virtual memory map of the database. No
copy required.
This commit is contained in:
William Casarin 2023-08-26 22:11:12 -07:00
parent 0bbc2c6348
commit 984c7b6932

View File

@ -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)
}
}