@@ -370,15 +370,19 @@ class MemTableConstructor: public Constructor {
370
370
: Constructor(cmp),
371
371
internal_comparator_(cmp),
372
372
table_factory_(new SkipListFactory) {
373
- memtable_ = new MemTable (internal_comparator_, table_factory_.get ());
373
+ Options options;
374
+ options.memtable_factory = table_factory_;
375
+ memtable_ = new MemTable (internal_comparator_, options);
374
376
memtable_->Ref ();
375
377
}
376
378
~MemTableConstructor () {
377
379
delete memtable_->Unref ();
378
380
}
379
381
virtual Status FinishImpl (const Options& options, const KVMap& data) {
380
382
delete memtable_->Unref ();
381
- memtable_ = new MemTable (internal_comparator_, table_factory_.get ());
383
+ Options memtable_options;
384
+ memtable_options.memtable_factory = table_factory_;
385
+ memtable_ = new MemTable (internal_comparator_, memtable_options);
382
386
memtable_->Ref ();
383
387
int seq = 1 ;
384
388
for (KVMap::const_iterator it = data.begin ();
@@ -1268,10 +1272,11 @@ class MemTableTest { };
1268
1272
TEST (MemTableTest, Simple) {
1269
1273
InternalKeyComparator cmp (BytewiseComparator ());
1270
1274
auto table_factory = std::make_shared<SkipListFactory>();
1271
- MemTable* memtable = new MemTable (cmp, table_factory.get ());
1275
+ Options options;
1276
+ options.memtable_factory = table_factory;
1277
+ MemTable* memtable = new MemTable (cmp, options);
1272
1278
memtable->Ref ();
1273
1279
WriteBatch batch;
1274
- Options options;
1275
1280
WriteBatchInternal::SetSequence (&batch, 100 );
1276
1281
batch.Put (std::string (" k1" ), std::string (" v1" ));
1277
1282
batch.Put (std::string (" k2" ), std::string (" v2" ));
0 commit comments