forked from bloomberg/bde-allocator-benchmarks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbde-patches-minimal
More file actions
77 lines (70 loc) · 2.66 KB
/
Copy pathbde-patches-minimal
File metadata and controls
77 lines (70 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
diff --git a/groups/bdl/bdlma/bdlma_bufferedsequentialpool.h b/groups/bdl/bdlma/bdlma_bufferedsequentialpool.h
index bf08cdc..c3ade13 100644
--- a/groups/bdl/bdlma/bdlma_bufferedsequentialpool.h
+++ b/groups/bdl/bdlma/bdlma_bufferedsequentialpool.h
@@ -465,6 +467,8 @@ class BufferedSequentialPool {
// memory obtained from the allocator supplied at construction. The
// behavior is undefined unless '0 < size'.
+ void deallocate(void*) {}
+
template <class TYPE>
void deleteObjectRaw(const TYPE *object);
// Destroy the specified 'object'. Note that memory associated with
diff --git a/groups/bdl/bdlma/bdlma_multipool.h b/groups/bdl/bdlma/bdlma_multipool.h
index d68e24c..cc96c15 100644
--- a/groups/bdl/bdlma/bdlma_multipool.h
+++ b/groups/bdl/bdlma/bdlma_multipool.h
@@ -761,6 +769,21 @@ int Multipool::maxPooledBlockSize() const
} // close package namespace
} // close enterprise namespace
+// FREE OPERATORS
+inline
+void *operator new(bsl::size_t size,
+ BloombergLP::bdlma::Multipool& pool)
+{
+ return pool.allocate(size);
+}
+
+inline
+void operator delete(void* p, BloombergLP::bdlma::Multipool& pool)
+{
+ pool.deallocate(p);
+}
+
+
#endif
// ----------------------------------------------------------------------------
diff --git a/groups/bsl/bslstl/bslstl_allocator.h b/groups/bsl/bslstl/bslstl_allocator.h
index 4a0a1a2..34c352e 100644
--- a/groups/bsl/bslstl/bslstl_allocator.h
+++ b/groups/bsl/bslstl/bslstl_allocator.h
@@ -516,6 +516,7 @@ class allocator {
// object with the specified 'p'. The optionally specified 'n'
// argument is ignored by this allocator type.
+#if 0
void construct(pointer p, const TYPE& val);
// Copy-construct an object of (template parameter) 'TYPE' from the
// specified 'val' at the memory address specified by 'p'. Do not
@@ -525,6 +526,9 @@ class allocator {
void destroy(pointer p);
// Call the 'TYPE' destructor for the object pointed to by the
// specified 'p'. Do not directly deallocate any memory.
+#endif
+ allocator select_on_container_copy_construction(const allocator&)
+ { return BloombergLP::bslma::Default::allocator(); }
// ACCESSORS
pointer address(reference x) const;
@@ -743,6 +747,7 @@ void allocator<TYPE>::deallocate(typename allocator::pointer p,
d_mechanism->deallocate(p);
}
+#if 0
template <class TYPE>
inline
void allocator<TYPE>::construct(typename allocator::pointer p,
@@ -757,6 +762,7 @@ void allocator<TYPE>::destroy(typename allocator::pointer p)
{
p->~TYPE();
}
+#endif
// ACCESSORS
template <class TYPE>