summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordgrogan@chromium.org <dgrogan@chromium.org@62dab493-f737-651d-591e-8d6aee1b9529>2011-06-02 00:00:37 +0000
committerdgrogan@chromium.org <dgrogan@chromium.org@62dab493-f737-651d-591e-8d6aee1b9529>2011-06-02 00:00:37 +0000
commitc4f551494838681f49cc8fb52baaf417d1fea2b1 (patch)
treebb977cbc52ebc724677a81d51ca3ead272893ecd
parent740d8b3d009462eed28a94ea516d667e735b0dfc (diff)
downloadleveldb-c4f551494838681f49cc8fb52baaf417d1fea2b1.tar.gz
sync with upstream @21627589
Minor changes: * Reformat the bodies of the iterator interface routines in IteratorWrapper to make them a bit easier to read * Switched the default in the leveldb makefile to be optimized mode, rather than debug mode * Fix build problem in chromium port git-svn-id: https://leveldb.googlecode.com/svn/trunk@30 62dab493-f737-651d-591e-8d6aee1b9529
-rw-r--r--Makefile12
-rw-r--r--leveldb.gyp3
-rw-r--r--table/iterator_wrapper.h18
3 files changed, 21 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 5eadd72..921b71c 100644
--- a/Makefile
+++ b/Makefile
@@ -4,9 +4,15 @@
CC = g++
-# Uncomment one of the following to switch between debug and opt mode
-#OPT = -O2 -DNDEBUG
-OPT = -g2
+#-----------------------------------------------
+# Uncomment exactly one of the lines labelled (A), (B), and (C) below
+# to switch between compilation modes.
+
+OPT = -O2 -DNDEBUG # (A) Production use (optimized mode)
+# OPT = -g2 # (B) Debug mode, w/ full line-level debugging symbols
+# OPT = -O2 -g2 -DNDEBUG # (C) Profiling mode: opt, but w/debugging symbols
+#-----------------------------------------------
+
UNAME := $(shell uname)
diff --git a/leveldb.gyp b/leveldb.gyp
index 8376592..ea634a2 100644
--- a/leveldb.gyp
+++ b/leveldb.gyp
@@ -35,6 +35,9 @@
# The base libary is a lightweight abstraction layer for things like
# threads and IO. http://src.chromium.org/viewvc/chrome/trunk/src/base/
'../../base/base.gyp:base',
+ # base::LazyInstance is a template that pulls in dynamic_annotations so
+ # we need to explictly link in the code for dynamic_annotations.
+ '../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
],
'conditions': [
['use_snappy', {
diff --git a/table/iterator_wrapper.h b/table/iterator_wrapper.h
index d8ca2b3..9e16b3d 100644
--- a/table/iterator_wrapper.h
+++ b/table/iterator_wrapper.h
@@ -34,16 +34,16 @@ class IteratorWrapper {
// Iterator interface methods
- bool Valid() const { return valid_; }
- Slice key() const { assert(Valid()); return key_; }
- Slice value() const { assert(Valid()); return iter_->value(); }
+ bool Valid() const { return valid_; }
+ Slice key() const { assert(Valid()); return key_; }
+ Slice value() const { assert(Valid()); return iter_->value(); }
// Methods below require iter() != NULL
- Status status() const { assert(iter_); return iter_->status(); }
- void Next() { assert(iter_); iter_->Next(); Update(); }
- void Prev() { assert(iter_); iter_->Prev(); Update(); }
- void Seek(const Slice& k) { assert(iter_); iter_->Seek(k); Update(); }
- void SeekToFirst() { assert(iter_); iter_->SeekToFirst(); Update(); }
- void SeekToLast() { assert(iter_); iter_->SeekToLast(); Update(); }
+ Status status() const { assert(iter_); return iter_->status(); }
+ void Next() { assert(iter_); iter_->Next(); Update(); }
+ void Prev() { assert(iter_); iter_->Prev(); Update(); }
+ void Seek(const Slice& k) { assert(iter_); iter_->Seek(k); Update(); }
+ void SeekToFirst() { assert(iter_); iter_->SeekToFirst(); Update(); }
+ void SeekToLast() { assert(iter_); iter_->SeekToLast(); Update(); }
private:
void Update() {