bmatsuo / lmdb-go

Bindings for the LMDB C library
BSD 3-Clause "New" or "Revised" License
156 stars 58 forks source link

lmdb: slice pointers without reflect #68

Closed bmatsuo closed 8 years ago

bmatsuo commented 8 years ago

Fixes #67

Uses a temporary conversion from unsafe.Pointer to *[valMaxSize]byte to create a slice of the actual data length (and capacity).

edit: It does not appear to slow anything down. If anything it makes things slightly faster. And it avoids a direct dependency on the "reflect" package.