mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
ethdb/pebble: use Pebble's internal constant calculation
This commit is contained in:
parent
38c2925944
commit
2941c522bb
1 changed files with 9 additions and 2 deletions
|
|
@ -146,8 +146,15 @@ func New(file string, cache int, handles int, namespace string, readonly bool, e
|
||||||
|
|
||||||
// The max memtable size is limited by the uint32 offsets stored in
|
// The max memtable size is limited by the uint32 offsets stored in
|
||||||
// internal/arenaskl.node, DeferredBatchOp, and flushableBatchEntry.
|
// internal/arenaskl.node, DeferredBatchOp, and flushableBatchEntry.
|
||||||
// Taken from https://github.com/cockroachdb/pebble/blob/master/open.go#L38
|
//
|
||||||
maxMemTableSize := 4<<30 - 1 // Capped by 4 GB
|
// - MaxUint32 on 64-bit platforms;
|
||||||
|
// - MaxInt on 32-bit platforms.
|
||||||
|
//
|
||||||
|
// It is used when slices are limited to Uint32 on 64-bit platforms (the
|
||||||
|
// length limit for slices is naturally MaxInt on 32-bit platforms).
|
||||||
|
//
|
||||||
|
// Taken from https://github.com/cockroachdb/pebble/blob/master/internal/constants/constants.go
|
||||||
|
maxMemTableSize := (1<<31)<<(^uint(0)>>63) - 1
|
||||||
|
|
||||||
// Two memory tables is configured which is identical to leveldb,
|
// Two memory tables is configured which is identical to leveldb,
|
||||||
// including a frozen memory table and another live one.
|
// including a frozen memory table and another live one.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue