leveldb-ruby 0.10 → 0.11

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.
Files changed (116) hide show
  1. data/ext/leveldb/extconf.rb +2 -6
  2. data/ext/leveldb/leveldb.cc +377 -33
  3. data/ext/leveldb/platform.rb +83 -0
  4. data/leveldb/Makefile +29 -28
  5. data/leveldb/build_detect_platform +23 -4
  6. data/leveldb/db/builder.cc +1 -1
  7. data/leveldb/db/builder.h +1 -1
  8. data/leveldb/db/corruption_test.cc +1 -1
  9. data/leveldb/db/db_bench.cc +2 -2
  10. data/leveldb/db/db_impl.cc +8 -16
  11. data/leveldb/db/db_impl.h +1 -1
  12. data/leveldb/db/db_iter.cc +1 -1
  13. data/leveldb/db/db_iter.h +1 -1
  14. data/leveldb/db/db_test.cc +180 -9
  15. data/leveldb/db/dbformat.cc +9 -7
  16. data/leveldb/db/dbformat.h +2 -2
  17. data/leveldb/db/dbformat_test.cc +1 -1
  18. data/leveldb/db/filename.cc +6 -2
  19. data/leveldb/db/filename.h +1 -1
  20. data/leveldb/db/filename_test.cc +1 -1
  21. data/leveldb/db/log_format.h +2 -2
  22. data/leveldb/db/log_reader.cc +2 -2
  23. data/leveldb/db/log_reader.h +2 -2
  24. data/leveldb/db/log_test.cc +2 -2
  25. data/leveldb/db/log_writer.cc +2 -2
  26. data/leveldb/db/log_writer.h +2 -2
  27. data/leveldb/db/memtable.cc +1 -1
  28. data/leveldb/db/memtable.h +1 -1
  29. data/leveldb/db/repair.cc +2 -2
  30. data/leveldb/db/skiplist.h +1 -1
  31. data/leveldb/db/skiplist_test.cc +1 -1
  32. data/leveldb/db/snapshot.h +1 -1
  33. data/leveldb/db/table_cache.cc +1 -1
  34. data/leveldb/db/table_cache.h +1 -1
  35. data/leveldb/db/version_edit.cc +1 -1
  36. data/leveldb/db/version_edit.h +1 -1
  37. data/leveldb/db/version_edit_test.cc +1 -1
  38. data/leveldb/db/version_set.cc +39 -14
  39. data/leveldb/db/version_set.h +1 -1
  40. data/leveldb/db/version_set_test.cc +1 -1
  41. data/leveldb/db/write_batch.cc +2 -2
  42. data/leveldb/db/write_batch_internal.h +1 -1
  43. data/leveldb/db/write_batch_test.cc +1 -1
  44. data/leveldb/helpers/memenv/memenv.cc +374 -0
  45. data/leveldb/helpers/memenv/memenv.h +20 -0
  46. data/leveldb/helpers/memenv/memenv_test.cc +232 -0
  47. data/leveldb/include/leveldb/cache.h +1 -1
  48. data/leveldb/include/leveldb/comparator.h +1 -1
  49. data/leveldb/include/leveldb/db.h +1 -1
  50. data/leveldb/include/leveldb/env.h +1 -1
  51. data/leveldb/include/leveldb/iterator.h +1 -1
  52. data/leveldb/include/leveldb/options.h +1 -1
  53. data/leveldb/include/leveldb/slice.h +1 -1
  54. data/leveldb/include/leveldb/status.h +1 -1
  55. data/leveldb/include/leveldb/table.h +1 -1
  56. data/leveldb/include/leveldb/table_builder.h +1 -1
  57. data/leveldb/include/leveldb/write_batch.h +1 -1
  58. data/leveldb/port/atomic_pointer.h +2 -2
  59. data/leveldb/port/port_android.cc +2 -2
  60. data/leveldb/port/port_android.h +2 -2
  61. data/leveldb/port/port_example.h +2 -2
  62. data/leveldb/port/port_posix.cc +2 -2
  63. data/leveldb/port/port_posix.h +11 -3
  64. data/leveldb/table/block.cc +1 -1
  65. data/leveldb/table/block.h +1 -1
  66. data/leveldb/table/block_builder.cc +1 -1
  67. data/leveldb/table/block_builder.h +1 -1
  68. data/leveldb/table/format.cc +1 -1
  69. data/leveldb/table/format.h +1 -1
  70. data/leveldb/table/iterator.cc +2 -2
  71. data/leveldb/table/merger.cc +2 -2
  72. data/leveldb/table/merger.h +1 -1
  73. data/leveldb/table/table.cc +1 -1
  74. data/leveldb/table/table_builder.cc +1 -1
  75. data/leveldb/table/table_test.cc +3 -3
  76. data/leveldb/table/two_level_iterator.cc +2 -2
  77. data/leveldb/table/two_level_iterator.h +1 -1
  78. data/leveldb/util/arena.cc +1 -1
  79. data/leveldb/util/arena.h +1 -1
  80. data/leveldb/util/arena_test.cc +1 -1
  81. data/leveldb/util/cache.cc +1 -1
  82. data/leveldb/util/cache_test.cc +1 -1
  83. data/leveldb/util/coding.cc +1 -1
  84. data/leveldb/util/coding.h +1 -1
  85. data/leveldb/util/coding_test.cc +1 -1
  86. data/leveldb/util/comparator.cc +7 -4
  87. data/leveldb/util/crc32c.cc +2 -2
  88. data/leveldb/util/crc32c.h +2 -2
  89. data/leveldb/util/crc32c_test.cc +2 -2
  90. data/leveldb/util/env.cc +17 -3
  91. data/leveldb/util/env_posix.cc +2 -2
  92. data/leveldb/util/env_test.cc +13 -11
  93. data/leveldb/util/hash.cc +1 -1
  94. data/leveldb/util/histogram.cc +1 -1
  95. data/leveldb/util/histogram.h +1 -1
  96. data/leveldb/util/logging.cc +1 -1
  97. data/leveldb/util/logging.h +1 -1
  98. data/leveldb/util/mutexlock.h +1 -1
  99. data/leveldb/util/options.cc +1 -1
  100. data/leveldb/util/posix_logger.h +1 -1
  101. data/leveldb/util/random.h +1 -1
  102. data/leveldb/util/status.cc +1 -1
  103. data/leveldb/util/testharness.cc +2 -2
  104. data/leveldb/util/testharness.h +2 -2
  105. data/leveldb/util/testutil.cc +2 -2
  106. data/leveldb/util/testutil.h +2 -2
  107. data/lib/leveldb.rb +34 -2
  108. metadata +7 -13
  109. data/leveldb/port/port_chromium.cc +0 -80
  110. data/leveldb/port/port_chromium.h +0 -97
  111. data/leveldb/port/port_osx.cc +0 -50
  112. data/leveldb/port/port_osx.h +0 -125
  113. data/leveldb/port/sha1_portable.cc +0 -298
  114. data/leveldb/port/sha1_portable.h +0 -25
  115. data/leveldb/port/sha1_test.cc +0 -39
  116. data/leveldb/util/env_chromium.cc +0 -612
@@ -54,6 +54,6 @@ class Random {
54
54
  }
55
55
  };
56
56
 
57
- }
57
+ } // namespace leveldb
58
58
 
59
59
  #endif // STORAGE_LEVELDB_UTIL_RANDOM_H_
@@ -72,4 +72,4 @@ std::string Status::ToString() const {
72
72
  }
73
73
  }
74
74
 
75
- }
75
+ } // namespace leveldb
@@ -73,5 +73,5 @@ int RandomSeed() {
73
73
  return result;
74
74
  }
75
75
 
76
- }
77
- }
76
+ } // namespace test
77
+ } // namespace leveldb
@@ -132,7 +132,7 @@ void TCONCAT(_Test_,name)::_Run()
132
132
  extern bool RegisterTest(const char* base, const char* name, void (*func)());
133
133
 
134
134
 
135
- }
136
- }
135
+ } // namespace test
136
+ } // namespace leveldb
137
137
 
138
138
  #endif // STORAGE_LEVELDB_UTIL_TESTHARNESS_H_
@@ -47,5 +47,5 @@ extern Slice CompressibleString(Random* rnd, double compressed_fraction,
47
47
  return Slice(*dst);
48
48
  }
49
49
 
50
- }
51
- }
50
+ } // namespace test
51
+ } // namespace leveldb
@@ -47,7 +47,7 @@ class ErrorEnv : public EnvWrapper {
47
47
  }
48
48
  };
49
49
 
50
- }
51
- }
50
+ } // namespace test
51
+ } // namespace leveldb
52
52
 
53
53
  #endif // STORAGE_LEVELDB_UTIL_TESTUTIL_H_
@@ -4,7 +4,6 @@ module LevelDB
4
4
  class DB
5
5
  include Enumerable
6
6
  class << self
7
-
8
7
  ## Loads or creates a LevelDB database as necessary, stored on disk at
9
8
  ## +pathname+.
10
9
  def new pathname
@@ -29,16 +28,49 @@ class DB
29
28
  def path_string pathname
30
29
  File.respond_to?(:path) ? File.path(pathname) : pathname.to_str
31
30
  end
32
-
33
31
  end
34
32
 
33
+ attr_reader :pathname
34
+
35
35
  alias :includes? :exists?
36
36
  alias :contains? :exists?
37
37
  alias :member? :exists?
38
38
  alias :[] :get
39
39
  alias :[]= :put
40
40
 
41
+ def each(*args, &block)
42
+ i = iterator(*args)
43
+ i.each(&block) if block
44
+ i
45
+ end
46
+
47
+ def iterator(*args); Iterator.new self, *args end
41
48
  def keys; map { |k, v| k } end
42
49
  def values; map { |k, v| v } end
50
+
51
+ def inspect
52
+ %(<#{self.class} #{@pathname.inspect}>)
53
+ end
54
+ end
55
+
56
+ class Iterator
57
+ include Enumerable
58
+
59
+ attr_reader :db, :from, :to
60
+
61
+ def self.new(db, opts={})
62
+ make db, opts
63
+ end
64
+
65
+ def reversed?; @reversed end
66
+ def inspect
67
+ %(<#{self.class} #{@db.inspect} @from=#{@from.inspect} @to=#{@to.inspect}#{' (reversed)' if @reversed}>)
68
+ end
43
69
  end
70
+
71
+ class WriteBatch
72
+ class << self
73
+ private :new
74
+ end
44
75
  end
76
+ end # module LevelDB
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leveldb-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.10'
4
+ version: '0.11'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,8 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-26 14:26:21.000000000 -07:00
13
- default_executable:
12
+ date: 2012-03-07 00:00:00.000000000 Z
14
13
  dependencies: []
15
14
  description: LevelDB-Ruby is a Ruby binding to LevelDB.
16
15
  email: wmorgan-leveldb-ruby-gemspec@masanjin.net
@@ -23,6 +22,7 @@ extra_rdoc_files:
23
22
  files:
24
23
  - README
25
24
  - ext/leveldb/extconf.rb
25
+ - ext/leveldb/platform.rb
26
26
  - lib/leveldb.rb
27
27
  - ext/leveldb/leveldb.cc
28
28
  - leveldb/Makefile
@@ -66,6 +66,9 @@ files:
66
66
  - leveldb/db/write_batch.cc
67
67
  - leveldb/db/write_batch_internal.h
68
68
  - leveldb/db/write_batch_test.cc
69
+ - leveldb/helpers/memenv/memenv.cc
70
+ - leveldb/helpers/memenv/memenv.h
71
+ - leveldb/helpers/memenv/memenv_test.cc
69
72
  - leveldb/include/leveldb/c.h
70
73
  - leveldb/include/leveldb/cache.h
71
74
  - leveldb/include/leveldb/comparator.h
@@ -82,16 +85,9 @@ files:
82
85
  - leveldb/port/port.h
83
86
  - leveldb/port/port_android.cc
84
87
  - leveldb/port/port_android.h
85
- - leveldb/port/port_chromium.cc
86
- - leveldb/port/port_chromium.h
87
88
  - leveldb/port/port_example.h
88
- - leveldb/port/port_osx.cc
89
- - leveldb/port/port_osx.h
90
89
  - leveldb/port/port_posix.cc
91
90
  - leveldb/port/port_posix.h
92
- - leveldb/port/sha1_portable.cc
93
- - leveldb/port/sha1_portable.h
94
- - leveldb/port/sha1_test.cc
95
91
  - leveldb/port/win/stdint.h
96
92
  - leveldb/table/block.cc
97
93
  - leveldb/table/block.h
@@ -121,7 +117,6 @@ files:
121
117
  - leveldb/util/crc32c.h
122
118
  - leveldb/util/crc32c_test.cc
123
119
  - leveldb/util/env.cc
124
- - leveldb/util/env_chromium.cc
125
120
  - leveldb/util/env_posix.cc
126
121
  - leveldb/util/env_test.cc
127
122
  - leveldb/util/hash.cc
@@ -139,7 +134,6 @@ files:
139
134
  - leveldb/util/testharness.h
140
135
  - leveldb/util/testutil.cc
141
136
  - leveldb/util/testutil.h
142
- has_rdoc: true
143
137
  homepage: http://github.com/wmorgan/leveldb-ruby
144
138
  licenses: []
145
139
  post_install_message:
@@ -166,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
160
  version: '0'
167
161
  requirements: []
168
162
  rubyforge_project:
169
- rubygems_version: 1.6.0
163
+ rubygems_version: 1.8.11
170
164
  signing_key:
171
165
  specification_version: 3
172
166
  summary: a Ruby binding to LevelDB
@@ -1,80 +0,0 @@
1
- // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file. See the AUTHORS file for names of contributors.
4
-
5
- #include "port/port_chromium.h"
6
-
7
- #include "util/logging.h"
8
-
9
- #if defined(USE_SNAPPY)
10
- # include "third_party/snappy/src/snappy.h"
11
- #endif
12
-
13
- namespace leveldb {
14
- namespace port {
15
-
16
- Mutex::Mutex() {
17
- }
18
-
19
- Mutex::~Mutex() {
20
- }
21
-
22
- void Mutex::Lock() {
23
- mu_.Acquire();
24
- }
25
-
26
- void Mutex::Unlock() {
27
- mu_.Release();
28
- }
29
-
30
- void Mutex::AssertHeld() {
31
- mu_.AssertAcquired();
32
- }
33
-
34
- CondVar::CondVar(Mutex* mu)
35
- : cv_(&mu->mu_) {
36
- }
37
-
38
- CondVar::~CondVar() { }
39
-
40
- void CondVar::Wait() {
41
- cv_.Wait();
42
- }
43
-
44
- void CondVar::Signal(){
45
- cv_.Signal();
46
- }
47
-
48
- void CondVar::SignalAll() {
49
- cv_.Broadcast();
50
- }
51
-
52
- bool Snappy_Compress(const char* input, size_t input_length,
53
- std::string* output) {
54
- #if defined(USE_SNAPPY)
55
- output->resize(snappy::MaxCompressedLength(input_length));
56
- size_t outlen;
57
- snappy::RawCompress(input, input_length, &(*output)[0], &outlen);
58
- output->resize(outlen);
59
- return true;
60
- #else
61
- return false;
62
- #endif
63
- }
64
-
65
- bool Snappy_Uncompress(const char* input_data, size_t input_length,
66
- std::string* output) {
67
- #if defined(USE_SNAPPY)
68
- size_t ulength;
69
- if (!snappy::GetUncompressedLength(input_data, input_length, &ulength)) {
70
- return false;
71
- }
72
- output->resize(ulength);
73
- return snappy::RawUncompress(input_data, input_length, &(*output)[0]);
74
- #else
75
- return false;
76
- #endif
77
- }
78
-
79
- }
80
- }
@@ -1,97 +0,0 @@
1
- // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file. See the AUTHORS file for names of contributors.
4
- //
5
- // See port_example.h for documentation for the following types/functions.
6
-
7
- #ifndef STORAGE_LEVELDB_PORT_PORT_CHROMIUM_H_
8
- #define STORAGE_LEVELDB_PORT_PORT_CHROMIUM_H_
9
-
10
- #include <stdint.h>
11
- #include <string>
12
- #include <cstring>
13
- #include "base/atomicops.h"
14
- #include "base/basictypes.h"
15
- #include "base/logging.h"
16
- #include "base/synchronization/condition_variable.h"
17
- #include "base/synchronization/lock.h"
18
-
19
- // Linux's ThreadIdentifier() needs this.
20
- #if defined(OS_LINUX)
21
- # include <linux/unistd.h>
22
- #endif
23
-
24
- #if defined(OS_WIN)
25
- #define snprintf _snprintf
26
- #define va_copy(a, b) do { (a) = (b); } while (0)
27
- #endif
28
-
29
- namespace leveldb {
30
- namespace port {
31
-
32
- // Chromium only supports little endian.
33
- static const bool kLittleEndian = true;
34
-
35
- class Mutex {
36
- public:
37
- Mutex();
38
- ~Mutex();
39
- void Lock();
40
- void Unlock();
41
- void AssertHeld();
42
-
43
- private:
44
- base::Lock mu_;
45
-
46
- friend class CondVar;
47
- DISALLOW_COPY_AND_ASSIGN(Mutex);
48
- };
49
-
50
- class CondVar {
51
- public:
52
- explicit CondVar(Mutex* mu);
53
- ~CondVar();
54
- void Wait();
55
- void Signal();
56
- void SignalAll();
57
-
58
- private:
59
- base::ConditionVariable cv_;
60
-
61
- DISALLOW_COPY_AND_ASSIGN(CondVar);
62
- };
63
-
64
- class AtomicPointer {
65
- private:
66
- typedef base::subtle::AtomicWord Rep;
67
- Rep rep_;
68
- public:
69
- AtomicPointer() { }
70
- explicit AtomicPointer(void* p) : rep_(reinterpret_cast<Rep>(p)) {}
71
- inline void* Acquire_Load() const {
72
- return reinterpret_cast<void*>(::base::subtle::Acquire_Load(&rep_));
73
- }
74
- inline void Release_Store(void* v) {
75
- ::base::subtle::Release_Store(&rep_, reinterpret_cast<Rep>(v));
76
- }
77
- inline void* NoBarrier_Load() const {
78
- return reinterpret_cast<void*>(::base::subtle::NoBarrier_Load(&rep_));
79
- }
80
- inline void NoBarrier_Store(void* v) {
81
- ::base::subtle::NoBarrier_Store(&rep_, reinterpret_cast<Rep>(v));
82
- }
83
- };
84
-
85
- bool Snappy_Compress(const char* input, size_t input_length,
86
- std::string* output);
87
- bool Snappy_Uncompress(const char* input_data, size_t input_length,
88
- std::string* output);
89
-
90
- inline bool GetHeapProfile(void (*func)(void*, const char*, int), void* arg) {
91
- return false;
92
- }
93
-
94
- }
95
- }
96
-
97
- #endif // STORAGE_LEVELDB_PORT_PORT_CHROMIUM_H_
@@ -1,50 +0,0 @@
1
- // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file. See the AUTHORS file for names of contributors.
4
-
5
- #include "port_osx.h"
6
-
7
- #include <cstdlib>
8
- #include <stdio.h>
9
- #include <string.h>
10
- #include "util/logging.h"
11
-
12
- namespace leveldb {
13
- namespace port {
14
-
15
- static void PthreadCall(const char* label, int result) {
16
- if (result != 0) {
17
- fprintf(stderr, "pthread %s: %s\n", label, strerror(result));
18
- abort();
19
- }
20
- }
21
-
22
- Mutex::Mutex() { PthreadCall("init mutex", pthread_mutex_init(&mu_, NULL)); }
23
-
24
- Mutex::~Mutex() { PthreadCall("destroy mutex", pthread_mutex_destroy(&mu_)); }
25
-
26
- void Mutex::Lock() { PthreadCall("lock", pthread_mutex_lock(&mu_)); }
27
-
28
- void Mutex::Unlock() { PthreadCall("unlock", pthread_mutex_unlock(&mu_)); }
29
-
30
- CondVar::CondVar(Mutex* mu)
31
- : mu_(mu) {
32
- PthreadCall("init cv", pthread_cond_init(&cv_, NULL));
33
- }
34
-
35
- CondVar::~CondVar() { PthreadCall("destroy cv", pthread_cond_destroy(&cv_)); }
36
-
37
- void CondVar::Wait() {
38
- PthreadCall("wait", pthread_cond_wait(&cv_, &mu_->mu_));
39
- }
40
-
41
- void CondVar::Signal() {
42
- PthreadCall("signal", pthread_cond_signal(&cv_));
43
- }
44
-
45
- void CondVar::SignalAll() {
46
- PthreadCall("broadcast", pthread_cond_broadcast(&cv_));
47
- }
48
-
49
- }
50
- }
@@ -1,125 +0,0 @@
1
- // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file. See the AUTHORS file for names of contributors.
4
- //
5
- // See port_example.h for documentation for the following types/functions.
6
-
7
- #ifndef STORAGE_LEVELDB_PORT_PORT_OSX_H_
8
- #define STORAGE_LEVELDB_PORT_PORT_OSX_H_
9
-
10
- #include <libkern/OSAtomic.h>
11
- #include <machine/endian.h>
12
- #include <pthread.h>
13
- #include <stdint.h>
14
-
15
- #include <string>
16
-
17
- namespace leveldb {
18
-
19
- // The following 4 methods implemented here for the benefit of env_posix.cc.
20
- inline size_t fread_unlocked(void *a, size_t b, size_t c, FILE *d) {
21
- return fread(a, b, c, d);
22
- }
23
-
24
- inline size_t fwrite_unlocked(const void *a, size_t b, size_t c, FILE *d) {
25
- return fwrite(a, b, c, d);
26
- }
27
-
28
- inline int fflush_unlocked(FILE *f) {
29
- return fflush(f);
30
- }
31
-
32
- inline int fdatasync(int fd) {
33
- return fsync(fd);
34
- }
35
-
36
- namespace port {
37
-
38
- static const bool kLittleEndian = (__DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN);
39
-
40
- // ------------------ Threading -------------------
41
-
42
- // A Mutex represents an exclusive lock.
43
- class Mutex {
44
- public:
45
- Mutex();
46
- ~Mutex();
47
-
48
- void Lock();
49
- void Unlock();
50
- void AssertHeld() { }
51
-
52
- private:
53
- friend class CondVar;
54
- pthread_mutex_t mu_;
55
-
56
- // No copying
57
- Mutex(const Mutex&);
58
- void operator=(const Mutex&);
59
- };
60
-
61
- class CondVar {
62
- public:
63
- explicit CondVar(Mutex* mu);
64
- ~CondVar();
65
-
66
- void Wait();
67
- void Signal();
68
- void SignalAll();
69
-
70
- private:
71
- pthread_cond_t cv_;
72
- Mutex* mu_;
73
- };
74
-
75
- inline void MemoryBarrier() {
76
- #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
77
- // See http://gcc.gnu.org/ml/gcc/2003-04/msg01180.html for a discussion on
78
- // this idiom. Also see http://en.wikipedia.org/wiki/Memory_ordering.
79
- __asm__ __volatile__("" : : : "memory");
80
- #else
81
- OSMemoryBarrier();
82
- #endif
83
- }
84
-
85
- class AtomicPointer {
86
- private:
87
- void* ptr_;
88
- public:
89
- AtomicPointer() { }
90
- explicit AtomicPointer(void* p) : ptr_(p) {}
91
- inline void* Acquire_Load() const {
92
- void* ptr = ptr_;
93
- MemoryBarrier();
94
- return ptr;
95
- }
96
- inline void Release_Store(void* v) {
97
- MemoryBarrier();
98
- ptr_ = v;
99
- }
100
- inline void* NoBarrier_Load() const {
101
- return ptr_;
102
- }
103
- inline void NoBarrier_Store(void* v) {
104
- ptr_ = v;
105
- }
106
- };
107
-
108
- inline bool Snappy_Compress(const char* input, size_t input_length,
109
- std::string* output) {
110
- return false;
111
- }
112
-
113
- inline bool Snappy_Uncompress(const char* input_data, size_t input_length,
114
- std::string* output) {
115
- return false;
116
- }
117
-
118
- inline bool GetHeapProfile(void (*func)(void*, const char*, int), void* arg) {
119
- return false;
120
- }
121
-
122
- }
123
- }
124
-
125
- #endif // STORAGE_LEVELDB_PORT_PORT_OSX_H_