MCPcopy Create free account
hub / github.com/bailey27/cppcryptfs / IoBufferPool

Class IoBufferPool

libcppcryptfs/file/iobufferpool.h:60–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58};
59
60class IoBufferPool {
61private:
62 mutex m_mutex;
63 static const size_t m_max_size = 70*1024*1024;
64 size_t m_current_size;
65 list<IoBuffer*> m_buffers;
66
67 IoBufferPool() : m_current_size(0) {};
68
69public:
70
71 // the size below is to accomodate the maximum i/o buffer size + enough IVs to write up to 64MB
72 static const size_t m_max_pool_buffer_size = ((MAX_IO_BUFFER_KB * 1024) / PLAIN_BS) * CIPHER_BS + ((64 * 1024 * 1024) / PLAIN_BS) * BLOCK_IV_LEN;
73
74 static IoBufferPool& getInstance();
75
76 // disallow copying and moving
77 IoBufferPool(IoBufferPool const&) = delete;
78 void operator=(IoBufferPool const&) = delete;
79 IoBufferPool(IoBufferPool const&&) = delete;
80 void operator=(IoBufferPool const&&) = delete;
81
82 ~IoBufferPool();
83 IoBuffer *GetIoBuffer(size_t buffer_size, size_t ivbufer_size);
84 void ReleaseIoBuffer(IoBuffer *pBuf);
85};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected