8#ifndef BOOST_SQLITE_ALLOCATOR_HPP
9#define BOOST_SQLITE_ALLOCATOR_HPP
11#include <boost/sqlite/detail/config.hpp>
16BOOST_SQLITE_BEGIN_NAMESPACE
21 constexpr allocator() noexcept {}
22 constexpr allocator(
const allocator& other )
noexcept {}
24 constexpr allocator(
const allocator<U>& other )
noexcept {}
26#if defined(SQLITE_4_BYTE_ALIGNED_MALLOC)
27 constexpr static std::size_t alignment = 4u;
29 constexpr static std::size_t alignment = 8u;
32 static_assert(
alignof(T) <= alignment,
"T alignment can't be fulfilled by sqlite");
33 [[nodiscard]] T* allocate( std::size_t n )
35 return static_cast<T*
>(sqlite3_malloc64(n *
sizeof(T)));
37 void deallocate( T* p, std::size_t)
39 return sqlite3_free(p);
43BOOST_SQLITE_END_NAMESPACE