Add -DPORTABLE=1 to MSVC CI build

Summary:
Add -DPORTABLE=1
  port::cacheline_aligned_alloc() has arguments swapped which prevents every single test from running.
Closes https://github.com/facebook/rocksdb/pull/2815

Differential Revision: D5751661

Pulled By: siying

fbshipit-source-id: e0857d6e138ec46035b3c23d7c3c751901a0a4a0
This commit is contained in:
Dmitri Smirnov 2017-08-31 16:42:05 -07:00 committed by Yi Wu
parent cf2b982375
commit aa00523e0e
3 changed files with 2 additions and 9 deletions

View File

@ -3,7 +3,7 @@ image: Visual Studio 2015
before_build:
- md %APPVEYOR_BUILD_FOLDER%\build
- cd %APPVEYOR_BUILD_FOLDER%\build
- cmake -G "Visual Studio 14 2015 Win64" -DOPTDBG=1 -DXPRESS=1 ..
- cmake -G "Visual Studio 14 2015 Win64" -DOPTDBG=1 -DXPRESS=1 -DPORTABLE=1 ..
- cd ..
build:
project: build\rocksdb.sln

7
cache/lru_cache.cc vendored
View File

@ -465,14 +465,7 @@ LRUCache::LRUCache(size_t capacity, int num_shard_bits,
bool strict_capacity_limit, double high_pri_pool_ratio)
: ShardedCache(capacity, num_shard_bits, strict_capacity_limit) {
num_shards_ = 1 << num_shard_bits;
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable: 4316) // We've validated the alignment with the new operators
#endif
shards_ = new LRUCacheShard[num_shards_];
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
SetCapacity(capacity);
SetStrictCapacityLimit(strict_capacity_limit);
for (int i = 0; i < num_shards_; i++) {

View File

@ -242,7 +242,7 @@ extern void InitOnce(OnceType* once, void (*initializer)());
inline void *cacheline_aligned_alloc(size_t size) {
return _aligned_malloc(CACHE_LINE_SIZE, size);
return _aligned_malloc(size, CACHE_LINE_SIZE);
}
inline void cacheline_aligned_free(void *memblock) {