From 65e6a41df1292d97b5f7a2016c4b081e5b4bdb39 Mon Sep 17 00:00:00 2001 From: Zachary Levy Date: Thu, 4 Jun 2026 14:47:29 -0700 Subject: [PATCH] Val is now passed to helpers directly instead of through extra pointer. --- vendor/lmdb/examples/examples.odin | 2 +- vendor/lmdb/lmdb.odin | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vendor/lmdb/examples/examples.odin b/vendor/lmdb/examples/examples.odin index 4cc2d6b..eff83b2 100644 --- a/vendor/lmdb/examples/examples.odin +++ b/vendor/lmdb/examples/examples.odin @@ -80,7 +80,7 @@ main :: proc() { data_val: mdb.Val mdb.panic_on_err(mdb.txn_begin(environment, nil, {}, &txn_handle)) mdb.panic_on_err(mdb.get(txn_handle, db_handle, &key_val, &data_val)) - data_cpy := mdb.blittable_copy(&data_val, int) + data_cpy := mdb.blittable_copy(data_val, int) mdb.panic_on_err(mdb.txn_commit(txn_handle)) fmt.println("Get result:", data_cpy) } diff --git a/vendor/lmdb/lmdb.odin b/vendor/lmdb/lmdb.odin index a7131ae..6c072b0 100644 --- a/vendor/lmdb/lmdb.odin +++ b/vendor/lmdb/lmdb.odin @@ -186,7 +186,7 @@ blittable_val :: #force_inline proc(val_ptr: ^$T) -> Val { // Reads a blittable T out of the LMDB memory map by copying it into caller // storage. The returned T has no lifetime tie to the transaction. -blittable_copy :: #force_inline proc(val: ^Val, $T: typeid) -> T { +blittable_copy :: #force_inline proc(val: Val, $T: typeid) -> T { fmt.assertf( reflect.has_no_indirections(type_info_of(T)), "blitval_copy: type '%v' contains indirection and cannot be read directly from LMDB", @@ -202,7 +202,7 @@ blittable_copy :: #force_inline proc(val: ^Val, $T: typeid) -> T { // or silently corrupt the database (ENV_WRITEMAP). // MUST NOT be retained past txn_commit, txn_abort, or any subsequent write // operation on the same env — the pointer is invalidated. -blittable_view :: #force_inline proc(val: ^Val, $T: typeid) -> ^T { +blittable_view :: #force_inline proc(val: Val, $T: typeid) -> ^T { fmt.assertf( reflect.has_no_indirections(type_info_of(T)), "blitval_view: type '%v' contains indirection and cannot be viewed directly from LMDB", @@ -231,7 +231,7 @@ slice_val :: #force_inline proc(s: []$T) -> Val { // MUST be copied (e.g. slice.clone) if it needs to outlive the current // transaction; the view is invalidated by txn_commit, txn_abort, or any // subsequent write operation on the same env. -slice_view :: #force_inline proc(val: ^Val, $T: typeid) -> []T { +slice_view :: #force_inline proc(val: Val, $T: typeid) -> []T { fmt.assertf( reflect.has_no_indirections(type_info_of(T)), "slice_view: element type '%v' contains indirection and cannot be read directly from LMDB", @@ -253,7 +253,7 @@ string_val :: #force_inline proc(s: string) -> Val { // MUST be copied (e.g. strings.clone) if it needs to outlive the current // transaction; the view is invalidated by txn_commit, txn_abort, or any // subsequent write operation on the same env. -string_view :: #force_inline proc(val: ^Val) -> string { +string_view :: #force_inline proc(val: Val) -> string { return string((cast([^]u8)val.data)[:val.size]) }