File tree Expand file tree Collapse file tree
src/main/java/org/lmdbjava Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424
2525/**
2626 * Represents off-heap memory holding a key only.
27+ * Equivalent to {@link KeyVal} without the val part.
2728 *
2829 * @param <T> buffer type
2930 */
3031final class Key <T > implements AutoCloseable {
3132
3233 private static final MemoryManager MEM_MGR = RUNTIME .getMemoryManager ();
3334 private boolean closed ;
34- private T k ;
35+ private final T k ;
3536 private final BufferProxy <T > proxy ;
3637 private final Pointer ptrKey ;
37- private final long ptrKeyAddr ;
3838
3939 Key (final BufferProxy <T > proxy ) {
4040 requireNonNull (proxy );
4141 this .proxy = proxy ;
4242 this .k = proxy .allocate ();
4343 ptrKey = MEM_MGR .allocateTemporary (MDB_VAL_STRUCT_SIZE , false );
44- ptrKeyAddr = ptrKey .address ();
4544 }
4645
4746 @ Override
@@ -53,19 +52,10 @@ public void close() {
5352 proxy .deallocate (k );
5453 }
5554
56- T key () {
57- return k ;
58- }
59-
6055 void keyIn (final T key ) {
6156 proxy .in (key , ptrKey );
6257 }
6358
64- T keyOut () {
65- k = proxy .out (k , ptrKey );
66- return k ;
67- }
68-
6959 Pointer pointer () {
7060 return ptrKey ;
7161 }
You can’t perform that action at this time.
0 commit comments