summaryrefslogtreecommitdiff
path: root/src/mongo/util/intrusive_counter.h
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2019-03-18 10:42:34 -0400
committerAndrew Morrow <acm@mongodb.com>2019-03-18 12:30:35 -0400
commit5ab83a702659235ea138c62fca3e608bb1def8cf (patch)
treef35454ad60d606f45fadbd404374bb1d7ba8dc96 /src/mongo/util/intrusive_counter.h
parentdf4243e71b7c69c4da59c90e657f0749d6c9c979 (diff)
downloadmongo-5ab83a702659235ea138c62fca3e608bb1def8cf.tar.gz
Revert "SERVER-36243 Use sized deallocation."
This reverts commit afe082642124dbda2367cb51c3d748873df9bf7b.
Diffstat (limited to 'src/mongo/util/intrusive_counter.h')
-rw-r--r--src/mongo/util/intrusive_counter.h11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/mongo/util/intrusive_counter.h b/src/mongo/util/intrusive_counter.h
index 771f6db16b5..1ca640e5a4b 100644
--- a/src/mongo/util/intrusive_counter.h
+++ b/src/mongo/util/intrusive_counter.h
@@ -29,7 +29,6 @@
#pragma once
-#include <atomic>
#include <boost/intrusive_ptr.hpp>
#include <stdlib.h>
@@ -115,11 +114,7 @@ public:
#pragma warning(push)
#pragma warning(disable : 4291)
void operator delete(void* ptr) {
- // Accessing ptr here is technically undefined behavior, but the toolchains we use + UBSAN
- // are okay with it.
- // TODO When we are on C++20, this should change and use a destroying delete function.
- // See https://jira.mongodb.org/browse/SERVER-39506
- mongoFree(ptr, bytesRequiredForSize(reinterpret_cast<RCString*>(ptr)->size()));
+ free(ptr);
}
#pragma warning(pop)
@@ -130,10 +125,6 @@ private:
return mongoMalloc(realSize);
}
- static size_t bytesRequiredForSize(size_t size) {
- return sizeof(RCString) + size + 1;
- }
-
int _size; // does NOT include trailing NUL byte.
// char[_size+1] array allocated past end of class
};