lmdb 0.7.3 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +12 -4
- data/Rakefile +48 -0
- data/ext/lmdb_ext/extconf.rb +27 -10
- data/ext/lmdb_ext/lmdb_ext.c +22 -8
- data/lib/lmdb/database.rb +2 -1
- data/lib/lmdb/version.rb +1 -1
- data/lmdb.gemspec +4 -1
- data/spec/lmdb_spec.rb +9 -0
- data/vendor/liblmdb/VERSION +1 -0
- data/vendor/{libraries/liblmdb → liblmdb}/lmdb.h +18 -63
- data/vendor/{libraries/liblmdb → liblmdb}/mdb.c +583 -1480
- data/vendor/{libraries/liblmdb → liblmdb}/midl.c +0 -62
- data/vendor/{libraries/liblmdb → liblmdb}/midl.h +4 -16
- metadata +7 -34
- data/CONTRIBUTORS +0 -8
- data/behaviour.org +0 -35
- data/ext/lmdb_ext/prototypes.sh +0 -4
- data/vendor/libraries/liblmdb/.gitignore +0 -24
- data/vendor/libraries/liblmdb/COPYRIGHT +0 -20
- data/vendor/libraries/liblmdb/Doxyfile +0 -1631
- data/vendor/libraries/liblmdb/LICENSE +0 -47
- data/vendor/libraries/liblmdb/Makefile +0 -118
- data/vendor/libraries/liblmdb/intro.doc +0 -192
- data/vendor/libraries/liblmdb/mdb_copy.1 +0 -61
- data/vendor/libraries/liblmdb/mdb_copy.c +0 -84
- data/vendor/libraries/liblmdb/mdb_drop.1 +0 -40
- data/vendor/libraries/liblmdb/mdb_drop.c +0 -135
- data/vendor/libraries/liblmdb/mdb_dump.1 +0 -81
- data/vendor/libraries/liblmdb/mdb_dump.c +0 -319
- data/vendor/libraries/liblmdb/mdb_load.1 +0 -84
- data/vendor/libraries/liblmdb/mdb_load.c +0 -492
- data/vendor/libraries/liblmdb/mdb_stat.1 +0 -70
- data/vendor/libraries/liblmdb/mdb_stat.c +0 -264
- data/vendor/libraries/liblmdb/mtest.c +0 -177
- data/vendor/libraries/liblmdb/mtest2.c +0 -124
- data/vendor/libraries/liblmdb/mtest3.c +0 -133
- data/vendor/libraries/liblmdb/mtest4.c +0 -168
- data/vendor/libraries/liblmdb/mtest5.c +0 -135
- data/vendor/libraries/liblmdb/mtest6.c +0 -141
- data/vendor/libraries/liblmdb/sample-bdb.txt +0 -73
- data/vendor/libraries/liblmdb/sample-mdb.txt +0 -62
- data/vendor/libraries/liblmdb/tooltag +0 -27
|
@@ -355,67 +355,5 @@ int mdb_mid2l_append( MDB_ID2L ids, MDB_ID2 *id )
|
|
|
355
355
|
return 0;
|
|
356
356
|
}
|
|
357
357
|
|
|
358
|
-
#ifdef MDB_VL32
|
|
359
|
-
unsigned mdb_mid3l_search( MDB_ID3L ids, MDB_ID id )
|
|
360
|
-
{
|
|
361
|
-
/*
|
|
362
|
-
* binary search of id in ids
|
|
363
|
-
* if found, returns position of id
|
|
364
|
-
* if not found, returns first position greater than id
|
|
365
|
-
*/
|
|
366
|
-
unsigned base = 0;
|
|
367
|
-
unsigned cursor = 1;
|
|
368
|
-
int val = 0;
|
|
369
|
-
unsigned n = (unsigned)ids[0].mid;
|
|
370
|
-
|
|
371
|
-
while( 0 < n ) {
|
|
372
|
-
unsigned pivot = n >> 1;
|
|
373
|
-
cursor = base + pivot + 1;
|
|
374
|
-
val = CMP( id, ids[cursor].mid );
|
|
375
|
-
|
|
376
|
-
if( val < 0 ) {
|
|
377
|
-
n = pivot;
|
|
378
|
-
|
|
379
|
-
} else if ( val > 0 ) {
|
|
380
|
-
base = cursor;
|
|
381
|
-
n -= pivot + 1;
|
|
382
|
-
|
|
383
|
-
} else {
|
|
384
|
-
return cursor;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
if( val > 0 ) {
|
|
389
|
-
++cursor;
|
|
390
|
-
}
|
|
391
|
-
return cursor;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
int mdb_mid3l_insert( MDB_ID3L ids, MDB_ID3 *id )
|
|
395
|
-
{
|
|
396
|
-
unsigned x, i;
|
|
397
|
-
|
|
398
|
-
x = mdb_mid3l_search( ids, id->mid );
|
|
399
|
-
|
|
400
|
-
if( x < 1 ) {
|
|
401
|
-
/* internal error */
|
|
402
|
-
return -2;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
if ( x <= ids[0].mid && ids[x].mid == id->mid ) {
|
|
406
|
-
/* duplicate */
|
|
407
|
-
return -1;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
/* insert id */
|
|
411
|
-
ids[0].mid++;
|
|
412
|
-
for (i=(unsigned)ids[0].mid; i>x; i--)
|
|
413
|
-
ids[i] = ids[i-1];
|
|
414
|
-
ids[x] = *id;
|
|
415
|
-
|
|
416
|
-
return 0;
|
|
417
|
-
}
|
|
418
|
-
#endif /* MDB_VL32 */
|
|
419
|
-
|
|
420
358
|
/** @} */
|
|
421
359
|
/** @} */
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
#ifndef _MDB_MIDL_H_
|
|
28
28
|
#define _MDB_MIDL_H_
|
|
29
29
|
|
|
30
|
-
#include
|
|
30
|
+
#include <stddef.h>
|
|
31
31
|
|
|
32
32
|
#ifdef __cplusplus
|
|
33
33
|
extern "C" {
|
|
@@ -43,7 +43,7 @@ extern "C" {
|
|
|
43
43
|
/** A generic unsigned ID number. These were entryIDs in back-bdb.
|
|
44
44
|
* Preferably it should have the same size as a pointer.
|
|
45
45
|
*/
|
|
46
|
-
typedef
|
|
46
|
+
typedef size_t MDB_ID;
|
|
47
47
|
|
|
48
48
|
/** An IDL is an ID List, a sorted array of IDs. The first
|
|
49
49
|
* element of the array is a counter for how many actual
|
|
@@ -56,7 +56,9 @@ typedef MDB_ID *MDB_IDL;
|
|
|
56
56
|
/* IDL sizes - likely should be even bigger
|
|
57
57
|
* limiting factors: sizeof(ID), thread stack size
|
|
58
58
|
*/
|
|
59
|
+
#ifndef MDB_IDL_LOGN
|
|
59
60
|
#define MDB_IDL_LOGN 16 /* DB_SIZE is 2^16, UM_SIZE is 2^17 */
|
|
61
|
+
#endif
|
|
60
62
|
#define MDB_IDL_DB_SIZE (1<<MDB_IDL_LOGN)
|
|
61
63
|
#define MDB_IDL_UM_SIZE (1<<(MDB_IDL_LOGN+1))
|
|
62
64
|
|
|
@@ -178,20 +180,6 @@ int mdb_mid2l_insert( MDB_ID2L ids, MDB_ID2 *id );
|
|
|
178
180
|
*/
|
|
179
181
|
int mdb_mid2l_append( MDB_ID2L ids, MDB_ID2 *id );
|
|
180
182
|
|
|
181
|
-
#ifdef MDB_VL32
|
|
182
|
-
typedef struct MDB_ID3 {
|
|
183
|
-
MDB_ID mid; /**< The ID */
|
|
184
|
-
void *mptr; /**< The pointer */
|
|
185
|
-
unsigned int mcnt; /**< Number of pages */
|
|
186
|
-
unsigned int mref; /**< Refcounter */
|
|
187
|
-
} MDB_ID3;
|
|
188
|
-
|
|
189
|
-
typedef MDB_ID3 *MDB_ID3L;
|
|
190
|
-
|
|
191
|
-
unsigned mdb_mid3l_search( MDB_ID3L ids, MDB_ID id );
|
|
192
|
-
int mdb_mid3l_insert( MDB_ID3L ids, MDB_ID3 *id );
|
|
193
|
-
|
|
194
|
-
#endif /* MDB_VL32 */
|
|
195
183
|
/** @} */
|
|
196
184
|
/** @} */
|
|
197
185
|
#ifdef __cplusplus
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lmdb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel Mendler
|
|
8
8
|
- Dorian Taylor
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-06-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -74,11 +74,9 @@ extensions:
|
|
|
74
74
|
extra_rdoc_files: []
|
|
75
75
|
files:
|
|
76
76
|
- CHANGES
|
|
77
|
-
- CONTRIBUTORS
|
|
78
77
|
- Gemfile
|
|
79
78
|
- README.md
|
|
80
79
|
- Rakefile
|
|
81
|
-
- behaviour.org
|
|
82
80
|
- ext/lmdb_ext/cursor_delete_flags.h
|
|
83
81
|
- ext/lmdb_ext/cursor_put_flags.h
|
|
84
82
|
- ext/lmdb_ext/dbi_flags.h
|
|
@@ -88,7 +86,6 @@ files:
|
|
|
88
86
|
- ext/lmdb_ext/flag_parser.h
|
|
89
87
|
- ext/lmdb_ext/lmdb_ext.c
|
|
90
88
|
- ext/lmdb_ext/lmdb_ext.h
|
|
91
|
-
- ext/lmdb_ext/prototypes.sh
|
|
92
89
|
- ext/lmdb_ext/put_flags.h
|
|
93
90
|
- lib/lmdb.rb
|
|
94
91
|
- lib/lmdb/database.rb
|
|
@@ -96,35 +93,11 @@ files:
|
|
|
96
93
|
- lmdb.gemspec
|
|
97
94
|
- spec/helper.rb
|
|
98
95
|
- spec/lmdb_spec.rb
|
|
99
|
-
- vendor/
|
|
100
|
-
- vendor/
|
|
101
|
-
- vendor/
|
|
102
|
-
- vendor/
|
|
103
|
-
- vendor/
|
|
104
|
-
- vendor/libraries/liblmdb/intro.doc
|
|
105
|
-
- vendor/libraries/liblmdb/lmdb.h
|
|
106
|
-
- vendor/libraries/liblmdb/mdb.c
|
|
107
|
-
- vendor/libraries/liblmdb/mdb_copy.1
|
|
108
|
-
- vendor/libraries/liblmdb/mdb_copy.c
|
|
109
|
-
- vendor/libraries/liblmdb/mdb_drop.1
|
|
110
|
-
- vendor/libraries/liblmdb/mdb_drop.c
|
|
111
|
-
- vendor/libraries/liblmdb/mdb_dump.1
|
|
112
|
-
- vendor/libraries/liblmdb/mdb_dump.c
|
|
113
|
-
- vendor/libraries/liblmdb/mdb_load.1
|
|
114
|
-
- vendor/libraries/liblmdb/mdb_load.c
|
|
115
|
-
- vendor/libraries/liblmdb/mdb_stat.1
|
|
116
|
-
- vendor/libraries/liblmdb/mdb_stat.c
|
|
117
|
-
- vendor/libraries/liblmdb/midl.c
|
|
118
|
-
- vendor/libraries/liblmdb/midl.h
|
|
119
|
-
- vendor/libraries/liblmdb/mtest.c
|
|
120
|
-
- vendor/libraries/liblmdb/mtest2.c
|
|
121
|
-
- vendor/libraries/liblmdb/mtest3.c
|
|
122
|
-
- vendor/libraries/liblmdb/mtest4.c
|
|
123
|
-
- vendor/libraries/liblmdb/mtest5.c
|
|
124
|
-
- vendor/libraries/liblmdb/mtest6.c
|
|
125
|
-
- vendor/libraries/liblmdb/sample-bdb.txt
|
|
126
|
-
- vendor/libraries/liblmdb/sample-mdb.txt
|
|
127
|
-
- vendor/libraries/liblmdb/tooltag
|
|
96
|
+
- vendor/liblmdb/VERSION
|
|
97
|
+
- vendor/liblmdb/lmdb.h
|
|
98
|
+
- vendor/liblmdb/mdb.c
|
|
99
|
+
- vendor/liblmdb/midl.c
|
|
100
|
+
- vendor/liblmdb/midl.h
|
|
128
101
|
homepage: https://github.com/doriantaylor/rb-lmdb
|
|
129
102
|
licenses:
|
|
130
103
|
- MIT
|
data/CONTRIBUTORS
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
Daniel Mendler <mail@daniel-mendler.de>
|
|
2
|
-
Dimitrij Denissenko <dimitrij.denissenko@blacksquaremedia.com>
|
|
3
|
-
Evgeniy Dolzhenko <evgeniy.dolzhenko@blacksquaremedia.com>
|
|
4
|
-
Julien Ammous <schmurfy@gmail.com>
|
|
5
|
-
Nathaniel Pierce <nwpierce@gmail.com>
|
|
6
|
-
Richard Golding <golding@chrysaetos.org>
|
|
7
|
-
Joel VanderWerf <vjoel@users.sourceforge.net>
|
|
8
|
-
Dorian Taylor <code@doriantaylor.com>
|
data/behaviour.org
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
#+STARTUP: showall hidestars
|
|
2
|
-
* the situtation
|
|
3
|
-
- lmdb has two kinds of transaction: read-write and read-only
|
|
4
|
-
- there are two properties associated with transactions:
|
|
5
|
-
- nesting
|
|
6
|
-
- multiplicity
|
|
7
|
-
- *read-write* transactions can nest, but there can only be one stack of read-write transactions per *database*, that is, amongst /all/ threads and all processes attached to the persitent storage.
|
|
8
|
-
- *read-only* transactions /cannot/ nest (because it's not meaningful for a read-only transaction to nest), but there can be a read-only transaction per thread (and of course multiple threads per process).
|
|
9
|
-
- (i can't remember if you can have a thread with a read-write *and* read-only transaction going but we can probably assume not)
|
|
10
|
-
- so therefore we need a way to distinguish between read-write and read-only as well as identify the thread /across processes/ that has the one read-write transaction open.
|
|
11
|
-
* undocumented behaviour
|
|
12
|
-
** ~mdb_txn_begin~
|
|
13
|
-
- if the environment is read-only and the transaction is read-write, returns ~EACCES~
|
|
14
|
-
- if there is a parent transaction and the current transaction's flags are ~MDB_RDONLY~ or ~MDB_WRITEMAP~ (?) or ~TXN_BLOCKED~
|
|
15
|
-
- if the *parent's* transaction is ~MDB_TXN_RDONLY~ (which is the same as ~MDB_RDONLY~), return ~EINVAL~
|
|
16
|
-
- that's saying "read-only transactions can't be nested"
|
|
17
|
-
- otherwise, return ~MDB_BAD_TXN~
|
|
18
|
-
- this is saying "read-only transactions can't be children of read-write parents"
|
|
19
|
-
- otherwise a few boring scenarios where the function may return ~ENOMEM~
|
|
20
|
-
- otherwise check ~mdb_cursor_shadow~ or ~mdb_txn_renew0~
|
|
21
|
-
- XXX does ~mdb_txn_begin~ block when waiting for the read-write??
|
|
22
|
-
* desired behaviour
|
|
23
|
-
** ruby interface
|
|
24
|
-
- when the ruby programmer opens a read-only transaction within a read-only transaction, this should be a noop
|
|
25
|
-
- don't push any stack, don't allocate any resources, just do nothing
|
|
26
|
-
- when the ruby programmer opens a read-only transaction within a read-/write/ transaction, this should raise an exception
|
|
27
|
-
- in practice there's no harm except that this is more about communicating the right thing to the ruby programmer
|
|
28
|
-
- do we warn?
|
|
29
|
-
- problem: there's no way to know (via the lmdb api) if another process has a read-write transaction open
|
|
30
|
-
- poll?
|
|
31
|
-
- actually no it probably doesn't matter (the mdb api blocks anyway?)
|
|
32
|
-
- /actually/ actually, the cursed-ass goto pseudo-loop containing the ~CALL_WITHOUT_GVL~ deals with that
|
|
33
|
-
** internal implementation
|
|
34
|
-
- a successfully-created read-write transaction has to set ~rw_txn_thread~ to the current thread (unless it is a sub-transaction in which case noop)
|
|
35
|
-
- when a read-write transaction is committed or aborted, ~rw_txn_thread~ has to be set back to null (unless the transaction has a parent)
|
data/ext/lmdb_ext/prototypes.sh
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
mtest
|
|
2
|
-
mtest[23456]
|
|
3
|
-
testdb
|
|
4
|
-
mdb_copy
|
|
5
|
-
mdb_stat
|
|
6
|
-
mdb_dump
|
|
7
|
-
mdb_load
|
|
8
|
-
mdb_drop
|
|
9
|
-
*.lo
|
|
10
|
-
*.[ao]
|
|
11
|
-
*.so
|
|
12
|
-
*.exe
|
|
13
|
-
*[~#]
|
|
14
|
-
*.bak
|
|
15
|
-
*.orig
|
|
16
|
-
*.rej
|
|
17
|
-
*.gcov
|
|
18
|
-
*.gcda
|
|
19
|
-
*.gcno
|
|
20
|
-
core
|
|
21
|
-
core.*
|
|
22
|
-
valgrind.*
|
|
23
|
-
man/
|
|
24
|
-
html/
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
Copyright 2011-2021 Howard Chu, Symas Corp.
|
|
2
|
-
All rights reserved.
|
|
3
|
-
|
|
4
|
-
Redistribution and use in source and binary forms, with or without
|
|
5
|
-
modification, are permitted only as authorized by the OpenLDAP
|
|
6
|
-
Public License.
|
|
7
|
-
|
|
8
|
-
A copy of this license is available in the file LICENSE in the
|
|
9
|
-
top-level directory of the distribution or, alternatively, at
|
|
10
|
-
<http://www.OpenLDAP.org/license.html>.
|
|
11
|
-
|
|
12
|
-
OpenLDAP is a registered trademark of the OpenLDAP Foundation.
|
|
13
|
-
|
|
14
|
-
Individual files and/or contributed packages may be copyright by
|
|
15
|
-
other parties and/or subject to additional restrictions.
|
|
16
|
-
|
|
17
|
-
This work also contains materials derived from public sources.
|
|
18
|
-
|
|
19
|
-
Additional information about OpenLDAP can be obtained at
|
|
20
|
-
<http://www.openldap.org/>.
|