- Notifications
You must be signed in to change notification settings - Fork124
Open
Description
I assume that it doesn't matter that not all code paths hit the reachability fence. Is the presence of them at the end of the method all that is needed to stop premature GC?
e.g.
final Pointer transientKey = txn.kv().keyIn(key); final Pointer transientVal = txn.kv().valIn(val); final int mask = mask(true, flags); final int rc = LIB.mdb_put(txn.pointer(), ptr, txn.kv().pointerKey(), txn.kv().pointerVal(), mask); if (rc == MDB_KEYEXIST) { if (isSet(mask, MDB_NOOVERWRITE)) { txn.kv().valOut(); // marked as in,out in LMDB C docs } else if (!isSet(mask, MDB_NODUPDATA)) { checkRc(rc); } return false; } checkRc(rc); ReferenceUtil.reachabilityFence0(transientKey); ReferenceUtil.reachabilityFence0(transientVal); ReferenceUtil.reachabilityFence0(key); ReferenceUtil.reachabilityFence0(val);