#include <src/agg/agg_array.h>
◆ agg::block_allocator::block_type
| struct agg::block_allocator::block_type |
| Class Members |
|
int8u * |
data |
|
|
unsigned |
size |
|
◆ ~block_allocator()
| agg::block_allocator::~block_allocator |
( |
| ) |
|
|
inline |
810 {
812 }
void remove_all()
Definition agg_array.h:790
References remove_all().
◆ block_allocator()
| agg::block_allocator::block_allocator |
( |
unsigned |
block_size, |
|
|
unsigned |
block_ptr_inc = 256-8 |
|
) |
| |
|
inline |
814 :
822 {
823 }
unsigned m_max_blocks
Definition agg_array.h:889
unsigned m_block_ptr_inc
Definition agg_array.h:887
unsigned m_num_blocks
Definition agg_array.h:888
int8u * m_buf_ptr
Definition agg_array.h:891
block_type * m_blocks
Definition agg_array.h:890
unsigned m_block_size
Definition agg_array.h:886
unsigned m_rest
Definition agg_array.h:892
◆ allocate()
| int8u * agg::block_allocator::allocate |
( |
unsigned |
size, |
|
|
unsigned |
alignment = 1 |
|
) |
| |
|
inline |
827 {
828 if(size == 0) return 0;
830 {
832 if(alignment > 1)
833 {
834 unsigned align =
835 (alignment - unsigned((size_t)ptr) % alignment) % alignment;
836
838 ptr += align;
840 {
843 return ptr;
844 }
846 return allocate(size - align, alignment);
847 }
850 return ptr;
851 }
854 }
int8u * allocate(unsigned size, unsigned alignment=1)
Definition agg_array.h:826
void allocate_block(unsigned size)
Definition agg_array.h:858
constexpr auto size(const C &c) -> decltype(c.size())
Definition span.hpp:183
AGG_INT8U int8u
Definition agg_basics.h:120
References allocate(), allocate_block(), m_buf_ptr, and m_rest.
Referenced by allocate().
◆ allocate_block()
| void agg::block_allocator::allocate_block |
( |
unsigned |
size | ) |
|
|
inlineprivate |
859 {
862 {
863 block_type* new_blocks =
865
867 {
868 memcpy(new_blocks,
872 }
875 }
876
881
884 }
unsigned size
Definition agg_array.h:786
int8u * data
Definition agg_array.h:785
static T * allocate(unsigned num)
Definition agg_basics.h:38
static void deallocate(T *ptr, unsigned)
Definition agg_basics.h:39
References agg::pod_allocator< T >::allocate(), agg::block_allocator::block_type::data, agg::pod_allocator< T >::deallocate(), m_block_ptr_inc, m_block_size, m_blocks, m_buf_ptr, m_max_blocks, m_num_blocks, m_rest, and agg::block_allocator::block_type::size.
Referenced by allocate().
◆ remove_all()
| void agg::block_allocator::remove_all |
( |
| ) |
|
|
inline |
◆ m_block_ptr_inc
| unsigned agg::block_allocator::m_block_ptr_inc |
|
private |
◆ m_block_size
| unsigned agg::block_allocator::m_block_size |
|
private |
◆ m_blocks
◆ m_buf_ptr
| int8u* agg::block_allocator::m_buf_ptr |
|
private |
◆ m_max_blocks
| unsigned agg::block_allocator::m_max_blocks |
|
private |
◆ m_num_blocks
| unsigned agg::block_allocator::m_num_blocks |
|
private |
◆ m_rest
| unsigned agg::block_allocator::m_rest |
|
private |
The documentation for this class was generated from the following file: