blob: 7bf62ef8411784af73e747dafef761c82097e1f6 (
plain)
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
|
== `sqlite/memory.hpp`
The memory header provides C++-y access to the memory facilities of sqlite.
[source,cpp,subs=+quotes]
----
// A tag to allow `operator new`
struct memory_tag {};
// new operators <1>
void *operator new ( std::size_t size, boost::sqlite::memory_tag) noexcept;
void *operator new[]( std::size_t size, boost::sqlite::memory_tag) noexcept;
void operator delete ( void* ptr, boost::sqlite::memory_tag) noexcept;
// A unique ptr that uses sqlite3_malloc / sqlite3_free
template<typename T>
using unique_ptr = std::unique_ptr<T, __implementation_detail__>;
template<typename T, typename ... Args>
unique_ptr<T> make_unique(Args && ... args);
// Get the size of the allocated memory.
template<typename T>
std::size_t msize(const unique_ptr<T> & ptr);
---
<1> `new (sqlite::memory_tag{}) T()` uses sqlite3_malloc
|