| 210 | mallocator(const mallocator<U>&) { } |
| 211 | |
| 212 | T* allocate(std::size_t n) |
| 213 | { |
| 214 | if (n <= std::numeric_limits<std::size_t>::max() / sizeof(T)) { |
| 215 | if (auto ptr = std::malloc(n * sizeof(T))) { |
| 216 | return static_cast<T*>(ptr); |
| 217 | } |
| 218 | } |
| 219 | throw std::bad_alloc(); |
| 220 | } |
| 221 | void deallocate(T* ptr, std::size_t) |
| 222 | { |
| 223 | std::free(ptr); |