Displaying 1 result from an estimated 1 matches for "short_alloc".
2017 Jun 21
6
RFC: Cleaning up the Itanium demangler
...<std::size_t N>
+void
+arena<N>::deallocate(char* p, std::size_t n) noexcept
+{
+ if (pointer_in_buffer(p))
+ {
+ n = align_up(n);
+ if (p + n == ptr_)
+ ptr_ = p;
+ }
+ else
+ std::free(p);
+}
+
+template <class T, std::size_t N>
+class short_alloc
+{
+ arena<N>& a_;
+public:
+ typedef T value_type;
+
+public:
+ template <class _Up> struct rebind {typedef short_alloc<_Up, N> other;};
+
+ short_alloc(arena<N>& a) noexcept : a_(a) {}
+ template <class U>
+ short_alloc(const short_alloc...