about summary refs log tree commit diff
path: root/absl/container/fixed_array.h
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2018-01-25T18·52-0800
committerJohn Olson <jolson@google.com>2018-01-25T21·48-0500
commitf6eea9486ae1935017f42d1f89005ddafb0bd53a (patch)
tree5e326da9fc58dcbed3b2073a5db5991956674ea3 /absl/container/fixed_array.h
parentcf1db73d2ad969f0ebbe6f5ed42678517e493da2 (diff)
Changes imported from Abseil "staging" branch:
  - a74a7e9027e3f90835ae0f553f98be294781da18 Internal change by Abseil Team <absl-team@google.com>
  - 2d32db6ed063f93b67886b9c27602d5aea3c21f7 Add /D_SCL_SECURE_NO_WARNINGS to MSVC builds to disable c... by Jon Cohen <cohenjon@google.com>
  - 54f40318d1de67b6b25f8aa68343f8bbcde8c304 Use sized delete in FixedArray. by Chris Kennelly <ckennelly@google.com>
  - 193f50b3500ab1a102a00df4e05ad7b969e9337b Fixes some warnings that show up during builds with msvc. by Greg Miller <jgm@google.com>

GitOrigin-RevId: a74a7e9027e3f90835ae0f553f98be294781da18
Change-Id: I6d2b1f496974a1399ca5db6b71274368c2699a59
Diffstat (limited to 'absl/container/fixed_array.h')
-rw-r--r--absl/container/fixed_array.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/absl/container/fixed_array.h b/absl/container/fixed_array.h
index 1fec9d2b3784..b92d90564d21 100644
--- a/absl/container/fixed_array.h
+++ b/absl/container/fixed_array.h
@@ -458,7 +458,7 @@ class FixedArray {
       // Loop optimizes to nothing for trivially destructible T.
       for (Holder* p = end(); p != begin();) (--p)->~Holder();
       if (IsAllocated(size())) {
-        ::operator delete[](begin());
+        std::allocator<Holder>().deallocate(p_, n_);
       } else {
         this->AnnotateDestruct(size());
       }
@@ -470,17 +470,13 @@ class FixedArray {
    private:
     Holder* MakeHolder(size_type n) {
       if (IsAllocated(n)) {
-        return Allocate(n);
+        return std::allocator<Holder>().allocate(n);
       } else {
         this->AnnotateConstruct(n);
         return this->data();
       }
     }
 
-    Holder* Allocate(size_type n) {
-      return static_cast<Holder*>(::operator new[](n * sizeof(Holder)));
-    }
-
     bool IsAllocated(size_type n) const { return n > inline_elements; }
 
     const size_type n_;