24#ifndef MYSQL_BINLOG_EVENT_COMPRESSION_ZSTD_DEC_H
25#define MYSQL_BINLOG_EVENT_COMPRESSION_ZSTD_DEC_H
27#define ZSTD_STATIC_LINKING_ONLY 1
Polymorphism-free memory resource class with custom allocator and deallocator functions.
Definition: memory_resource.h:88
Abstract base class for decompressors.
Definition: decompressor.h:57
mysql::containers::buffers::Buffer_view< Char_t >::Size_t Size_t
Definition: decompressor.h:60
unsigned char Char_t
Definition: decompressor.h:59
mysql::containers::buffers::Grow_constraint Grow_constraint_t
Definition: decompressor.h:62
Decompressor class that uses the ZSTD library.
Definition: zstd_dec.h:37
static constexpr type type_code
Definition: zstd_dec.h:43
Zstd_dec & operator=(const Zstd_dec &&)=delete
std::pair< Decompress_status, Size_t > do_decompress(Char_t *out, Size_t output_size) override
Implement decompress.
Definition: zstd_dec.cpp:72
type do_get_type_code() const override
Definition: zstd_dec.cpp:45
static void * zstd_mem_res_alloc(void *opaque, size_t size)
Definition: zstd_dec.cpp:153
ZSTD_DStream * m_ctx
ZSTD decompression context object.
Definition: zstd_dec.h:74
void destroy()
Deallocate the ZSTD decompression context.
Definition: zstd_dec.cpp:38
Memory_resource_t m_memory_resource
Instrumented memory allocator object.
Definition: zstd_dec.h:82
static void zstd_mem_res_free(void *opaque, void *address)
Definition: zstd_dec.cpp:158
void do_feed(const Char_t *input_data, Size_t input_size) override
Implement feed.
Definition: zstd_dec.cpp:59
ZSTD_inBuffer m_ibuf
ZSTD input buffer.
Definition: zstd_dec.h:77
Zstd_dec(const Zstd_dec &)=delete
Zstd_dec(const Zstd_dec &&)=delete
Grow_constraint_t do_get_grow_constraint_hint() const override
Implement get_grow_constraint_hint.
Definition: zstd_dec.cpp:144
ZSTD_customMem m_zstd_custom_mem
ZSTD memory allocator objects and functions.
Definition: zstd_dec.h:85
void do_reset() override
Implement do_reset.
Definition: zstd_dec.cpp:47
mysql::allocators::Memory_resource Memory_resource_t
Definition: zstd_dec.h:42
Zstd_dec(const Memory_resource_t &memory_resource=Memory_resource_t())
Definition: zstd_dec.cpp:30
Zstd_dec & operator=(const Zstd_dec &)=delete
bool m_frame_boundary
Definition: zstd_dec.h:79
~Zstd_dec() override
Definition: zstd_dec.cpp:36
Description of a heuristic to determine how much memory to allocate.
Definition: grow_constraint.h:66
Class that wraps resources in a polymorphic manner.
type
Definition: base.h:40
@ ZSTD
Definition: base.h:42
size_t size(const char *const c)
Definition: base64.h:46
#define NODISCARD
The function attribute [[NODISCARD]] is a replacement for [[nodiscard]] to workaround a gcc bug.
Definition: nodiscard.h:47