[libcxx-commits] [libcxx] bfb1223 - [libc++] Mark std::pmr virtual functions as _LIBCPP_HIDE_FROM_ABI_VIRTUAL

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 17 13:08:34 PST 2023


Author: Nikolas Klauser
Date: 2023-01-17T22:08:29+01:00
New Revision: bfb122316b5b7288a9f82c8d40e5124448afb3be

URL: https://github.com/llvm/llvm-project/commit/bfb122316b5b7288a9f82c8d40e5124448afb3be
DIFF: https://github.com/llvm/llvm-project/commit/bfb122316b5b7288a9f82c8d40e5124448afb3be.diff

LOG: [libc++] Mark std::pmr virtual functions as _LIBCPP_HIDE_FROM_ABI_VIRTUAL

Reviewed By: ldionne, Mordante, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D141864

Added: 
    

Modified: 
    libcxx/include/__memory_resource/monotonic_buffer_resource.h
    libcxx/include/__memory_resource/synchronized_pool_resource.h
    libcxx/include/__memory_resource/unsynchronized_pool_resource.h

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__memory_resource/monotonic_buffer_resource.h b/libcxx/include/__memory_resource/monotonic_buffer_resource.h
index fd34d20c55466..5b0d2462582e7 100644
--- a/libcxx/include/__memory_resource/monotonic_buffer_resource.h
+++ b/libcxx/include/__memory_resource/monotonic_buffer_resource.h
@@ -80,7 +80,7 @@ class _LIBCPP_TYPE_VIS monotonic_buffer_resource : public memory_resource {
 
   monotonic_buffer_resource(const monotonic_buffer_resource&) = delete;
 
-  _LIBCPP_HIDE_FROM_ABI ~monotonic_buffer_resource() override { release(); }
+  _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~monotonic_buffer_resource() override { release(); }
 
   monotonic_buffer_resource& operator=(const monotonic_buffer_resource&) = delete;
 
@@ -99,9 +99,9 @@ class _LIBCPP_TYPE_VIS monotonic_buffer_resource : public memory_resource {
 protected:
   void* do_allocate(size_t __bytes, size_t __alignment) override; // key function
 
-  _LIBCPP_HIDE_FROM_ABI void do_deallocate(void*, size_t, size_t) override {}
+  _LIBCPP_HIDE_FROM_ABI_VIRTUAL void do_deallocate(void*, size_t, size_t) override {}
 
-  _LIBCPP_HIDE_FROM_ABI bool do_is_equal(const memory_resource& __other) const _NOEXCEPT override {
+  _LIBCPP_HIDE_FROM_ABI_VIRTUAL bool do_is_equal(const memory_resource& __other) const _NOEXCEPT override {
     return this == std::addressof(__other);
   }
 

diff  --git a/libcxx/include/__memory_resource/synchronized_pool_resource.h b/libcxx/include/__memory_resource/synchronized_pool_resource.h
index 550223c7d9689..1877147ca16fc 100644
--- a/libcxx/include/__memory_resource/synchronized_pool_resource.h
+++ b/libcxx/include/__memory_resource/synchronized_pool_resource.h
@@ -62,14 +62,14 @@ class _LIBCPP_TYPE_VIS synchronized_pool_resource : public memory_resource {
   _LIBCPP_HIDE_FROM_ABI pool_options options() const { return __unsync_.options(); }
 
 protected:
-  _LIBCPP_HIDE_FROM_ABI void* do_allocate(size_t __bytes, size_t __align) override {
+  _LIBCPP_HIDE_FROM_ABI_VIRTUAL void* do_allocate(size_t __bytes, size_t __align) override {
 #  if !defined(_LIBCPP_HAS_NO_THREADS)
     unique_lock<mutex> __lk(__mut_);
 #  endif
     return __unsync_.allocate(__bytes, __align);
   }
 
-  _LIBCPP_HIDE_FROM_ABI void do_deallocate(void* __p, size_t __bytes, size_t __align) override {
+  _LIBCPP_HIDE_FROM_ABI_VIRTUAL void do_deallocate(void* __p, size_t __bytes, size_t __align) override {
 #  if !defined(_LIBCPP_HAS_NO_THREADS)
     unique_lock<mutex> __lk(__mut_);
 #  endif

diff  --git a/libcxx/include/__memory_resource/unsynchronized_pool_resource.h b/libcxx/include/__memory_resource/unsynchronized_pool_resource.h
index 7270cf19e214a..2ecddcf6e3ae1 100644
--- a/libcxx/include/__memory_resource/unsynchronized_pool_resource.h
+++ b/libcxx/include/__memory_resource/unsynchronized_pool_resource.h
@@ -70,7 +70,7 @@ class _LIBCPP_TYPE_VIS unsynchronized_pool_resource : public memory_resource {
 
   unsynchronized_pool_resource(const unsynchronized_pool_resource&) = delete;
 
-  _LIBCPP_HIDE_FROM_ABI ~unsynchronized_pool_resource() override { release(); }
+  _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~unsynchronized_pool_resource() override { release(); }
 
   unsynchronized_pool_resource& operator=(const unsynchronized_pool_resource&) = delete;
 


        


More information about the libcxx-commits mailing list