From bc02910ff97c9d2e51d74a0ad364a221a97a5038 Mon Sep 17 00:00:00 2001 From: theWangs <1428148408@qq.com> Date: Thu, 22 May 2025 20:20:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?port=E7=9B=AE=E5=BD=95=E6=96=B0=E5=A2=9Elik?= =?UTF-8?q?ely.h=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- storage/rocksdb/rocksdb/port/likely.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 storage/rocksdb/rocksdb/port/likely.h diff --git a/storage/rocksdb/rocksdb/port/likely.h b/storage/rocksdb/rocksdb/port/likely.h new file mode 100644 index 000000000..397d75713 --- /dev/null +++ b/storage/rocksdb/rocksdb/port/likely.h @@ -0,0 +1,18 @@ +// Copyright (c) 2011-present, Facebook, Inc. All rights reserved. +// This source code is licensed under both the GPLv2 (found in the +// COPYING file in the root directory) and Apache 2.0 License +// (found in the LICENSE.Apache file in the root directory). +// +// Copyright (c) 2011 The LevelDB Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. See the AUTHORS file for names of contributors. + +#pragma once + +#if defined(__GNUC__) && __GNUC__ >= 4 +#define LIKELY(x) (__builtin_expect((x), 1)) +#define UNLIKELY(x) (__builtin_expect((x), 0)) +#else +#define LIKELY(x) (x) +#define UNLIKELY(x) (x) +#endif -- Gitee From 4e3e8baa9367c9840cac6d6250b3a6fca0616e5b Mon Sep 17 00:00:00 2001 From: theWangs <1428148408@qq.com> Date: Fri, 23 May 2025 08:41:18 +0800 Subject: [PATCH 2/2] =?UTF-8?q?port=E7=9B=AE=E5=BD=95=E6=96=B0=E5=A2=9Emal?= =?UTF-8?q?loc.h=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- storage/rocksdb/rocksdb/port/malloc.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 storage/rocksdb/rocksdb/port/malloc.h diff --git a/storage/rocksdb/rocksdb/port/malloc.h b/storage/rocksdb/rocksdb/port/malloc.h new file mode 100644 index 000000000..f973263e2 --- /dev/null +++ b/storage/rocksdb/rocksdb/port/malloc.h @@ -0,0 +1,17 @@ +// Copyright (c) 2011-present, Facebook, Inc. All rights reserved. +// This source code is licensed under both the GPLv2 (found in the +// COPYING file in the root directory) and Apache 2.0 License +// (found in the LICENSE.Apache file in the root directory). +// +// Copyright (c) 2011 The LevelDB Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. See the AUTHORS file for names of contributors. +#pragma once + +#ifdef ROCKSDB_MALLOC_USABLE_SIZE +#ifdef OS_FREEBSD +#include +#else +#include +#endif // OS_FREEBSD +#endif // ROCKSDB_MALLOC_USABLE_SIZE -- Gitee