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
Abstract base class for decompressors.
Definition: decompressor.h:57
unsigned char Char_t
Definition: decompressor.h:59
mysql::binlog::event::compression::buffer::Grow_constraint Grow_constraint_t
Definition: decompressor.h:65
mysql::binlog::event::compression::buffer::Buffer_view< Char_t >::Size_t Size_t
Definition: decompressor.h:61
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:73
type do_get_type_code() const override
Definition: zstd_dec.cpp:46
static void * zstd_mem_res_alloc(void *opaque, size_t size)
Definition: zstd_dec.cpp:154
ZSTD_DStream * m_ctx
ZSTD decompression context object.
Definition: zstd_dec.h:74
void destroy()
Deallocate the ZSTD decompression context.
Definition: zstd_dec.cpp:39
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:159
void do_feed(const Char_t *input_data, Size_t input_size) override
Implement feed.
Definition: zstd_dec.cpp:60
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:145
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:48
Zstd_dec(const Memory_resource_t &memory_resource=Memory_resource_t())
Definition: zstd_dec.cpp:31
Zstd_dec & operator=(const Zstd_dec &)=delete
bool m_frame_boundary
Definition: zstd_dec.h:79
mysql::binlog::event::resource::Memory_resource Memory_resource_t
Definition: zstd_dec.h:42
~Zstd_dec() override
Definition: zstd_dec.cpp:37
Description of a heuristic to determine how much memory to allocate.
Definition: grow_constraint.h:66
Polymorphism-free memory resource class with custom allocator and deallocator functions.
Definition: memory_resource.h:88
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