History log of /6.6.0/platform/include/ (Results 1 - 25 of 322)
Revision (<<< Hide revision tags) (Show revision tags >>>)Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
Revision tags: v6.5.1
66c0644503-Feb-2020 Dave Rigby <daver@couchbase.com>

MB-37096: NonNegativeCounter: Fix signed/unsigned mismatch

As reported by MSVC:

platform/non_negative_counter.h(127): warning C4018: '>': signed/unsigned mismatch
platfo

MB-37096: NonNegativeCounter: Fix signed/unsigned mismatch

As reported by MSVC:

platform/non_negative_counter.h(127): warning C4018: '>': signed/unsigned mismatch
platform/non_negative_counter.h(116): note: while compiling class template member function 'T
cb::NonNegativeCounter<T,cb::DefaultUnderflowPolicy>::fetch_add(__int64)'
with
[
T=uint64_t
]

Change-Id: I7a5f8ec3de31bc22c72f21f8e3df47bed627190c
Reviewed-on: http://review.couchbase.org/121578
Well-Formed: Build Bot <build@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Richard de Mellow <richard.demellow@couchbase.com>

show more ...

d3e7c4b429-Jan-2020 Dave Rigby <daver@couchbase.com>

MB-37096: Add setupWindowsDebugCRTAssertHandling()

Add a new function to platform - setupWindowsDebugCRTAssertHandling().

If running on Windows with a Debug build, direct error and

MB-37096: Add setupWindowsDebugCRTAssertHandling()

Add a new function to platform - setupWindowsDebugCRTAssertHandling().

If running on Windows with a Debug build, direct error and assertion
messages from the CRT to stderr, in addition to the default GUI
dialog box. Also prints a backtrace to the error.

Ensures that errors from Debug-mode tests etc are visible even if
running in a non-graphical mode (e.g. Jenkins CV job).

No-op on non-Windows, or if not a Debug build.

Change-Id: Ic71e918f8af4ccf6b5dc8d687eb447f43ec75567
Reviewed-on: http://review.couchbase.org/121349
Well-Formed: Build Bot <build@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>

show more ...

d74d705a06-Nov-2019 Dave Rigby <daver@couchbase.com>

MB-36776: Replace inefficient impl of htonll/ntohll with folly::Endian

platform.so has an implementation of the 64bit byteswap functions
ntohll() and htonll(), for platforms which don't

MB-36776: Replace inefficient impl of htonll/ntohll with folly::Endian

platform.so has an implementation of the 64bit byteswap functions
ntohll() and htonll(), for platforms which don't have that symbol
natively.

Profiling of ep-engine Writer threads highlighed that a large amount
of time (~5%) was being spent in platform's ntohll() / htonll()
functions. This was surprising, as:

a) I had assumed that modern Linux (CentOS 7) provided the 64bit
byteswap functions, and

b) Even if the OS doesn't have those functions, I assumed our
implementation shouldn't be _that_ slow.

(For context the top 10 functions in the profile are below, ntohll is
the 3rd hottest):

Overhead Command Shared Object Symbol
4.82% mc:writer_2 libsnappy.so.1.2.0 [.] snappy::internal::CompressFragment
4.33% mc:writer_2 [kernel.kallsyms] [k] _raw_spin_lock_irq
4.30% mc:writer_2 libplatform_so.so.0.1.0 [.] ntohll
2.82% mc:writer_2 libc-2.17.so [.] __memcpy_ssse3
2.49% mc:writer_2 libsnappy.so.1.2.0 [.] snappy::RawUncompress
2.36% mc:writer_2 [kernel.kallsyms] [k] _raw_spin_lock
1.99% mc:writer_2 libjemalloc.so.2 [.] je_malloc_usable_size
1.74% mc:writer_2 [kernel.kallsyms] [k] __radix_tree_lookup
1.43% mc:writer_2 libjemalloc.so.2 [.] je_malloc

Both my assumptions are actually incorrect:

- CentOS 7 (and other recent distros including Ubuntu 18.04) *don't*
have ntohll / htonll symbols. They *do* have functionally
equivilent function htobe64() since glibc 2.9 (2008), but that's a
different, Linux-specific symbol.

- Our implemenation _is_ slow - it's doing old-style manual byteswap,
which is 10x slower on mancouch than the GCC compiler intrinsic
__builtin_bswap64:

Run on (24 X 2400 MHz CPU s)
2019-11-06 12:20:30
-----------------------------------------------------
Benchmark Time CPU Iterations
-----------------------------------------------------
Swap64 57 ns 57 ns 12216131
BuiltinSwap64 5 ns 5 ns 141279127

Given we already have an optimized byteswap implementation available
from Folly, use that instead. Also inline the functions to reduce the
call overhead.

This results in the same performance as the GCC compiler intrinsic
(but is cross-platform):

Run on (24 X 2400 MHz CPU s)
2019-11-06 12:33:05
-----------------------------------------------------
Benchmark Time CPU Iterations
-----------------------------------------------------
Swap64 57 ns 57 ns 12507068
FollySwap64 5 ns 5 ns 135655965
BuiltinSwap64 5 ns 5 ns 100000000

Change-Id: I472be7705622b800c9849bfc0615fb49a73ccce8
Reviewed-on: http://review.couchbase.org/117439
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@couchbase.com>
Reviewed-by: Richard de Mellow <richard.demellow@couchbase.com>
Reviewed-by: Paolo Cocchi <paolo.cocchi@couchbase.com>

show more ...

1f20670108-Oct-2019 Trond Norbye <trond.norbye@gmail.com>

Let cb::compression::Buffer operators be consts

Change-Id: Ie30e3284ff0049e6f7672917f7029c98957fdaa8
Reviewed-on: http://review.couchbase.org/116096
Tested-by: Build Bot <build@couch

Let cb::compression::Buffer operators be consts

Change-Id: Ie30e3284ff0049e6f7672917f7029c98957fdaa8
Reviewed-on: http://review.couchbase.org/116096
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...

f42ec1e926-Sep-2019 Dave Rigby <daver@couchbase.com>

Allow memory order of AtomicDuration to be specified

Change AtomicDuration to a templated class, templated on the memory
order to use. Defaults to the same memory order it previously use

Allow memory order of AtomicDuration to be specified

Change AtomicDuration to a templated class, templated on the memory
order to use. Defaults to the same memory order it previously used
(relaxed).

Change-Id: I00221d1acbea73f12a00d679e595f91739d998c0
Reviewed-on: http://review.couchbase.org/115575
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Ben Huddleston <ben.huddleston@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@couchbase.com>

show more ...

d2114be801-Oct-2019 Trond Norbye <trond.norbye@gmail.com>

Add cb::compression::Buffer::empty()

Change-Id: I0064782cde55de34c75b53aeacdc47afb10ca215
Reviewed-on: http://review.couchbase.org/115642
Tested-by: Build Bot <build@couchbase.com>

Add cb::compression::Buffer::empty()

Change-Id: I0064782cde55de34c75b53aeacdc47afb10ca215
Reviewed-on: http://review.couchbase.org/115642
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...

91143b0928-Aug-2019 Dave Rigby <daver@couchbase.com>

NonNegativeCounter: Enforce invariant on construction

Change NonNegativeCounter to check that the argument passed to the
ctor is also not negative, so we catch attempts to construct an

NonNegativeCounter: Enforce invariant on construction

Change NonNegativeCounter to check that the argument passed to the
ctor is also not negative, so we catch attempts to construct an
invalid NonNegativeCounter.

(This change was motivated by a bug where we constructed a
NonNegativeCounter with a negative value, but didn't identify the
'underflow' until the /next/ time the counter was modified, which made
the bug hard to track down.)

Change-Id: Ib7d4079e977817aa17ea650b74de64e5b2cde868
Reviewed-on: http://review.couchbase.org/113966
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: James Harrison <james.harrison@couchbase.com>

show more ...

1d6d6c0308-Aug-2019 Ben Huddleston <ben.huddleston@couchbase.com>

MB-35630: Use Folly's AccessSpreader to determine cpu in CoreStore

Perf stats from Triton 2 node 80/20 R/W throughput test:
Before: ~3,435,129 ops/s (last 22 runs)
After: ~3,542,453

MB-35630: Use Folly's AccessSpreader to determine cpu in CoreStore

Perf stats from Triton 2 node 80/20 R/W throughput test:
Before: ~3,435,129 ops/s (last 22 runs)
After: ~3,542,453 ops/s (5 runs)

Change-Id: Id267c942b0e0d4c13f45ce5d76fd0d2663853032
Reviewed-on: http://review.couchbase.org/113076
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...

Revision tags: v6.0.3
17b14c9221-Jun-2019 Ben Huddleston <ben.huddleston@couchbase.com>

MB-34676: Add byte swap functions to UnsignedNByteInteger

We need to be able to write cb::uint48_t always in big endian order
to CouchStore. Add generic functions to swap the byte order

MB-34676: Add byte swap functions to UnsignedNByteInteger

We need to be able to write cb::uint48_t always in big endian order
to CouchStore. Add generic functions to swap the byte order to
UnsignedNByteInteger as they may be useful elsewhere.

Change-Id: If203af661b976ca3145eec1873ae9f30bce80c6c
Reviewed-on: http://review.couchbase.org/110997
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>

show more ...

fd7818a524-Apr-2019 Ben Huddleston <ben.huddleston@couchbase.com>

MB-33846: Make NonNegativeCounter deal with negatives

In the hash table in kv_engine we often add negative values.
This causes the stats to underflow. Correct this by doing similar
l

MB-33846: Make NonNegativeCounter deal with negatives

In the hash table in kv_engine we often add negative values.
This causes the stats to underflow. Correct this by doing similar
logic done in fetch_sub in fetch_add, and allowing fetch_add to
take a signed type. Also, allow fetch_sub to take a negative value
for consistency.

Change-Id: Ic63012ce41fe13a627477a386551aa7805ca00e2
Reviewed-on: http://review.couchbase.org/108202
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>

show more ...

cdf833f224-Apr-2019 Richard de Mellow <richard.demellow@couchbase.com>

CBD-2920 Fix compile errors with Xcode 10.2 command line tools

Fix compile errors with Xcode 10.2 command line tools after upgrading to
nlohmann::json v3.5.0.

Also as part of th

CBD-2920 Fix compile errors with Xcode 10.2 command line tools

Fix compile errors with Xcode 10.2 command line tools after upgrading to
nlohmann::json v3.5.0.

Also as part of this move functions that require <sstream> in pipe.h to
a pipe.cc so that we may use nlohmann/json_fwd.hpp.

Change-Id: I07478540030c758ff3a6c839f8aea83ecb8a4c16
Reviewed-on: http://review.couchbase.org/108663
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@couchbase.com>

show more ...

8c74fe5e25-Mar-2019 Richard de Mellow <richard.demellow@couchbase.com>

MB-22005: Make MicrosecondStopwatch templated

Make MicrosecondStopwatch templated so it can be used with
HdrHistogram

Change-Id: Ied31358b31cf97f121a8af8773f9def9685fb047
Re

MB-22005: Make MicrosecondStopwatch templated

Make MicrosecondStopwatch templated so it can be used with
HdrHistogram

Change-Id: Ied31358b31cf97f121a8af8773f9def9685fb047
Reviewed-on: http://review.couchbase.org/106860
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>

show more ...

becffd3b29-Mar-2019 Trond Norbye <trond.norbye@gmail.com>

Cleanup: Remove __sun and __FreeBSD__ code

We don't build on those platforms and we have no idea of
the current status.

Change-Id: Ifa752904f7c69c7d4fa188deb223e4aabed23fa9

Cleanup: Remove __sun and __FreeBSD__ code

We don't build on those platforms and we have no idea of
the current status.

Change-Id: Ifa752904f7c69c7d4fa188deb223e4aabed23fa9
Reviewed-on: http://review.couchbase.org/106994
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>

show more ...

994b855029-Mar-2019 Dave Rigby <daver@couchbase.com>

Merge remote-tracking branch 'couchbase/alice'

* couchbase/alice:
MB-33351: Don't throw in CoreStore.get()

Change-Id: I826c928bee1635f785dcbd95d8bdbd81ac03dc28


079961ee27-Mar-2019 Trond Norbye <trond.norbye@gmail.com>

MB-33327: Add support for software-only CRC32

If the target CPU isn't X86 don't try to use HW assisted functions

Change-Id: If1c021e97fde5842b158aca7ed886de7d0434b89
Reviewed-on

MB-33327: Add support for software-only CRC32

If the target CPU isn't X86 don't try to use HW assisted functions

Change-Id: If1c021e97fde5842b158aca7ed886de7d0434b89
Reviewed-on: http://review.couchbase.org/106855
Tested-by: Trond Norbye <trond.norbye@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
Reviewed-by: Jim Walker <jim@couchbase.com>

show more ...

87c134a827-Mar-2019 Trond Norbye <trond.norbye@gmail.com>

Cleanup: Don't build crc files multiple times

As a preparation for MB-33327 don't build the CRC32 related
source files more than once. Link and use the versions in
platform instead.

Cleanup: Don't build crc files multiple times

As a preparation for MB-33327 don't build the CRC32 related
source files more than once. Link and use the versions in
platform instead.

Change-Id: I83f84e8d07d77d934279812d184303e03274ea16
Reviewed-on: http://review.couchbase.org/106853
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...

Revision tags: v5.5.4
e379ad7619-Mar-2019 Ben Huddleston <ben.huddleston@couchbase.com>

MB-33351: Don't throw in CoreStore.get()

As we call CoreStore.get() from within the new and delete operators,
we cannot call new or throw anything from inside this function.
Calling

MB-33351: Don't throw in CoreStore.get()

As we call CoreStore.get() from within the new and delete operators,
we cannot call new or throw anything from inside this function.
Calling new would result in a recursive call via the new operator;
this would result in a stack overflow if we were calling new to create
and exception message, in the case where we would throw if our index
is out of range. Throwing from within a delete call would violate
noexcept on linux which results in a std::terminate.

Fix these issues by ensuring we always return something valid from
CoreStore.get(). In this case, something belonging to another core.
We'll get some cache contention, but this is better than crashing.

Change-Id: I56968d46215641787c1d01337c8dea619da0ffc3
Reviewed-on: http://review.couchbase.org/106491
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
Tested-by: David Haikney <david.haikney@couchbase.com>

show more ...

f3d54c1c18-Mar-2019 Ben Huddleston <ben.huddleston@couchbase.com>

MB-30040: Use folly's cacheline padded

Change-Id: Icc1a112609da8dac979f07b6e02916278131270a
Reviewed-on: http://review.couchbase.org/106427
Tested-by: Build Bot <build@couchbase.com>

MB-30040: Use folly's cacheline padded

Change-Id: Icc1a112609da8dac979f07b6e02916278131270a
Reviewed-on: http://review.couchbase.org/106427
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...

da567ebf20-Mar-2019 Trond Norbye <trond.norbye@gmail.com>

Get rid of config.h

Define all flags as compiler options with -DFOO=1

Change-Id: I8deab908c9feb08a090a56dafa8c3a9ecb1ed1e3
Reviewed-on: http://review.couchbase.org/106500
Te

Get rid of config.h

Define all flags as compiler options with -DFOO=1

Change-Id: I8deab908c9feb08a090a56dafa8c3a9ecb1ed1e3
Reviewed-on: http://review.couchbase.org/106500
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...

7b4c8fa305-Nov-2018 Dave Rigby <daver@couchbase.com>

MB-30040: Update platform to use Folly

Change-Id: Id2eeb0205ff3c1ddf4269876366613b4860c6c2a
Reviewed-on: http://review.couchbase.org/101368
Tested-by: Build Bot <build@couchbase.com>

MB-30040: Update platform to use Folly

Change-Id: Id2eeb0205ff3c1ddf4269876366613b4860c6c2a
Reviewed-on: http://review.couchbase.org/101368
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@couchbase.com>

show more ...

acda8ff315-Mar-2019 Trond Norbye <trond.norbye@gmail.com>

Header files should not include config.h

Change-Id: I29911b26033b35164ffa3747fa46b7c677cbce9b
Reviewed-on: http://review.couchbase.org/106297
Tested-by: Build Bot <build@couchbase.co

Header files should not include config.h

Change-Id: I29911b26033b35164ffa3747fa46b7c677cbce9b
Reviewed-on: http://review.couchbase.org/106297
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...

2f179c8014-Mar-2019 Trond Norbye <trond.norbye@gmail.com>

Remove C interface to our own random provider

And:

* Move platform specific code back into random.cc
as it's basically 3 small function calls

* move to the shor

Remove C interface to our own random provider

And:

* Move platform specific code back into random.cc
as it's basically 3 small function calls

* move to the shorter cb namespace

* Export the entire class

* clang-format

* Removed non-shared provider (not used)

Change-Id: Ic5163cf0d6e06804241498a1ba44cdb0d6fb9426
Reviewed-on: http://review.couchbase.org/106180
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...

cdc17db414-Mar-2019 Dave Rigby <daver@couchbase.com>

platform_socket.h: Add missing newline

platform/include/platform/platform_socket.h:78:7:
warning: no newline at end of file [-Wnewline-eof]

Change-Id: I451c8c7b0b51f195b

platform_socket.h: Add missing newline

platform/include/platform/platform_socket.h:78:7:
warning: no newline at end of file [-Wnewline-eof]

Change-Id: I451c8c7b0b51f195b08def07f895b3a0cd8ec510
Reviewed-on: http://review.couchbase.org/106182
Reviewed-by: Trond Norbye <trond.norbye@couchbase.com>
Tested-by: Trond Norbye <trond.norbye@couchbase.com>

show more ...

1a6af9b408-Mar-2019 Trond Norbye <trond.norbye@gmail.com>

Include what you use

Remove platform/platform.h

Change-Id: I593b9124c79660566b4e316a2e5f852351f3ded9
Reviewed-on: http://review.couchbase.org/106046
Reviewed-by: Dave Rigby

Include what you use

Remove platform/platform.h

Change-Id: I593b9124c79660566b4e316a2e5f852351f3ded9
Reviewed-on: http://review.couchbase.org/106046
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>

show more ...

ff948d7e07-Mar-2019 Richard de Mellow <richard.demellow@couchbase.com>

MB-22005 Add getMemFootPrint method to Histogram<>

Add getMemFootPrint method to Histogram so we can calculate the size
of a given Histogram<>.

Change-Id: I2c58fd009a19ccce7fadb

MB-22005 Add getMemFootPrint method to Histogram<>

Add getMemFootPrint method to Histogram so we can calculate the size
of a given Histogram<>.

Change-Id: I2c58fd009a19ccce7fadba9c070a315f1675020c
Reviewed-on: http://review.couchbase.org/105859
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>

show more ...

12345678910>>...13