aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/jemalloc
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.ru>2022-05-08 23:58:24 +0300
committerthegeorg <thegeorg@yandex-team.ru>2022-05-08 23:58:24 +0300
commitf4f3e4024a1f32bd0bc3fa20239025a1b179e42d (patch)
treeb9849b312dfaed13d937b7c82ce4d0c63a18b084 /contrib/libs/jemalloc
parentf6f01d5f4830e22efd8d2a5806f4ed13de4fe5b3 (diff)
downloadydb-f4f3e4024a1f32bd0bc3fa20239025a1b179e42d.tar.gz
jemalloc: For the further improvement of patching
ref:6883a616f4e2679f806b9b9e1d0f9fa693ab7467
Diffstat (limited to 'contrib/libs/jemalloc')
-rw-r--r--contrib/libs/jemalloc/CMakeLists.darwin.txt1
-rw-r--r--contrib/libs/jemalloc/CMakeLists.linux.txt1
-rw-r--r--contrib/libs/jemalloc/hack.cpp14
-rw-r--r--contrib/libs/jemalloc/hack.h21
-rw-r--r--contrib/libs/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h4
-rw-r--r--contrib/libs/jemalloc/include/jemalloc/internal/jemalloc_internal_defs-win.h3
-rw-r--r--contrib/libs/jemalloc/include/jemalloc/jemalloc-win.h2
-rw-r--r--contrib/libs/jemalloc/spinlock.h21
8 files changed, 5 insertions, 62 deletions
diff --git a/contrib/libs/jemalloc/CMakeLists.darwin.txt b/contrib/libs/jemalloc/CMakeLists.darwin.txt
index c286caa561..a72351a757 100644
--- a/contrib/libs/jemalloc/CMakeLists.darwin.txt
+++ b/contrib/libs/jemalloc/CMakeLists.darwin.txt
@@ -20,7 +20,6 @@ target_link_libraries(contrib-libs-jemalloc PUBLIC
)
target_sources(contrib-libs-jemalloc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/jemalloc/src/zone.c
- ${CMAKE_SOURCE_DIR}/contrib/libs/jemalloc/hack.cpp
${CMAKE_SOURCE_DIR}/contrib/libs/jemalloc/src/arena.c
${CMAKE_SOURCE_DIR}/contrib/libs/jemalloc/src/background_thread.c
${CMAKE_SOURCE_DIR}/contrib/libs/jemalloc/src/base.c
diff --git a/contrib/libs/jemalloc/CMakeLists.linux.txt b/contrib/libs/jemalloc/CMakeLists.linux.txt
index bcb3e53576..ec1532b072 100644
--- a/contrib/libs/jemalloc/CMakeLists.linux.txt
+++ b/contrib/libs/jemalloc/CMakeLists.linux.txt
@@ -21,7 +21,6 @@ target_link_libraries(contrib-libs-jemalloc PUBLIC
contrib-libs-libunwind
)
target_sources(contrib-libs-jemalloc PRIVATE
- ${CMAKE_SOURCE_DIR}/contrib/libs/jemalloc/hack.cpp
${CMAKE_SOURCE_DIR}/contrib/libs/jemalloc/src/arena.c
${CMAKE_SOURCE_DIR}/contrib/libs/jemalloc/src/background_thread.c
${CMAKE_SOURCE_DIR}/contrib/libs/jemalloc/src/base.c
diff --git a/contrib/libs/jemalloc/hack.cpp b/contrib/libs/jemalloc/hack.cpp
deleted file mode 100644
index 900856d353..0000000000
--- a/contrib/libs/jemalloc/hack.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#include "hack.h"
-
-#include <util/system/yield.cpp>
-#include <util/system/spinlock.cpp>
-
-#include "spinlock.h"
-
-void SPIN_L(spinlock_t* l) {
- AcquireAdaptiveLock(l);
-}
-
-void SPIN_U(spinlock_t* l) {
- ReleaseAdaptiveLock(l);
-}
diff --git a/contrib/libs/jemalloc/hack.h b/contrib/libs/jemalloc/hack.h
deleted file mode 100644
index 3b172a2da2..0000000000
--- a/contrib/libs/jemalloc/hack.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#pragma once
-
-#include <sys/types.h>
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-#define AcquireAdaptiveLockSlow AllocAcquireAdaptiveLockSlow
-#define SchedYield AllocSchedYield
-#define ThreadYield AllocThreadYield
-#define NSystemInfo NAllocSystemInfo
-
-#ifdef _MSC_VER
-# define __restrict__ __restrict
-# define JEMALLOC_EXPORT
-#endif
-
-#if defined(__cplusplus)
-};
-#endif
diff --git a/contrib/libs/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h b/contrib/libs/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h
index 46259be5aa..7d6053e219 100644
--- a/contrib/libs/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h
+++ b/contrib/libs/jemalloc/include/jemalloc/internal/jemalloc_internal_decls.h
@@ -1,10 +1,6 @@
#ifndef JEMALLOC_INTERNAL_DECLS_H
#define JEMALLOC_INTERNAL_DECLS_H
-// Yandex-specific: misc hacks.
-#include "../../../hack.h"
-// End of Yandex-specific.
-
#include <math.h>
#ifdef _WIN32
# include <windows.h>
diff --git a/contrib/libs/jemalloc/include/jemalloc/internal/jemalloc_internal_defs-win.h b/contrib/libs/jemalloc/include/jemalloc/internal/jemalloc_internal_defs-win.h
index a49610dbd0..f07e513e3c 100644
--- a/contrib/libs/jemalloc/include/jemalloc/internal/jemalloc_internal_defs-win.h
+++ b/contrib/libs/jemalloc/include/jemalloc/internal/jemalloc_internal_defs-win.h
@@ -2,6 +2,8 @@
#include "jemalloc_internal_defs-linux.h"
+
+
/*
* Define overrides for non-standard allocator-related functions if they are
* present on the system.
@@ -86,6 +88,7 @@
/* Use libunwind for profile backtracing if defined. */
#undef JEMALLOC_PROF_LIBUNWIND
+#undef JEMALLOC_PROF_LIBGCC
/*
* JEMALLOC_DSS enables use of sbrk(2) to allocate extents from the data storage
diff --git a/contrib/libs/jemalloc/include/jemalloc/jemalloc-win.h b/contrib/libs/jemalloc/include/jemalloc/jemalloc-win.h
index 76fe7d9f6b..10953140be 100644
--- a/contrib/libs/jemalloc/include/jemalloc/jemalloc-win.h
+++ b/contrib/libs/jemalloc/include/jemalloc/jemalloc-win.h
@@ -141,6 +141,8 @@ extern "C" {
# define JEMALLOC_CXX_THROW
#endif
+#define JEMALLOC_EXPORT
+
#if defined(_MSC_VER)
# define JEMALLOC_ATTR(s)
# define JEMALLOC_ALIGNED(s) __declspec(align(s))
diff --git a/contrib/libs/jemalloc/spinlock.h b/contrib/libs/jemalloc/spinlock.h
deleted file mode 100644
index 93fcf10e12..0000000000
--- a/contrib/libs/jemalloc/spinlock.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#pragma once
-
-#include <util/system/defaults.h>
-
-typedef volatile intptr_t spinlock_t;
-
-#define SPIN_L AllocAcquireAdaptiveLock
-#define SPIN_U AllocReleaseAdaptiveLock
-
-#define _SPINLOCK_INITIALIZER 0
-#define _SPINUNLOCK(_lck) SPIN_U(_lck)
-#define _SPINLOCK(_lck) SPIN_L(_lck)
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
- void SPIN_L(spinlock_t* lock);
- void SPIN_U(spinlock_t* lock);
-#if defined(__cplusplus)
-};
-#endif