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

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 16 10:27:25 PST 2023


philnik created this revision.
philnik added reviewers: ldionne, Mordante.
Herald added a project: All.
philnik requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141864

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


Index: libcxx/include/__memory_resource/unsynchronized_pool_resource.h
===================================================================
--- libcxx/include/__memory_resource/unsynchronized_pool_resource.h
+++ libcxx/include/__memory_resource/unsynchronized_pool_resource.h
@@ -70,7 +70,7 @@
 
   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;
 
Index: libcxx/include/__memory_resource/synchronized_pool_resource.h
===================================================================
--- libcxx/include/__memory_resource/synchronized_pool_resource.h
+++ libcxx/include/__memory_resource/synchronized_pool_resource.h
@@ -62,14 +62,14 @@
   _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
Index: libcxx/include/__memory_resource/monotonic_buffer_resource.h
===================================================================
--- libcxx/include/__memory_resource/monotonic_buffer_resource.h
+++ libcxx/include/__memory_resource/monotonic_buffer_resource.h
@@ -80,7 +80,7 @@
 
   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 @@
 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);
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141864.489596.patch
Type: text/x-patch
Size: 2804 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230116/9078a909/attachment.bin>


More information about the libcxx-commits mailing list