OpenJPH: ojph::mem_fixed_allocator Class Reference

OpenJPH Open-source implementation of JPEG2000 Part-15

Loading...
Searching...
No Matches
ojph::mem_fixed_allocator Class Reference

`#include <ojph_mem.h>`

## Public Member Functions
| mem_fixed_allocator ()
| ~mem_fixed_allocator ()
template<typename T>
void | pre_alloc_data (size_t num_ele, ui32 pre_size)
template<typename T>
void | pre_alloc_obj (size_t num_ele)
void | alloc ()
void | restart ()
template<typename T>
T * | post_alloc_data (size_t num_ele, ui32 pre_size)
template<typename T>
T * | post_alloc_obj (size_t num_ele)

## Private Member Functions
template<typename T, int N>
void | pre_alloc_local (size_t num_ele, ui32 pre_size, size_t &sz)
template<typename T, int N>
T * | post_alloc_local (size_t num_ele, ui32 pre_size, size_t &avail_sz, void *&avail_p)

## Private Attributes
void * | store
void * | avail_data
void * | avail_obj
size_t | size_data
size_t | size_obj
size_t | avail_size_obj
size_t | avail_size_data
size_t | allocated_data
bool | preallocation

## Detailed Description

Definition at line 58 of file ojph_mem.h.

## Constructor & Destructor Documentation

## ◆ mem_fixed_allocator()

ojph::mem_fixed_allocator::mem_fixed_allocator | ( |  | ) |
| inline

Definition at line 61 of file ojph_mem.h.

References allocated_data, restart(), and store.

## ◆ ~mem_fixed_allocator()

ojph::mem_fixed_allocator::~mem_fixed_allocator | ( |  | ) |
| inline

Definition at line 66 of file ojph_mem.h.

References store.

## Member Function Documentation

## ◆ alloc()

void ojph::mem_fixed_allocator::alloc | ( |  | ) |
| inline

Definition at line 83 of file ojph_mem.h.

References allocated_data, avail_data, avail_obj, avail_size_data, avail_size_obj, OJPH_ERROR, preallocation, size_data, size_obj, and store.

## ◆ post_alloc_data()

template<typename T>

T * ojph::mem_fixed_allocator::post_alloc_data | ( | size_t | num_ele,
|  | ui32 | pre_size )
| inline

Definition at line 112 of file ojph_mem.h.

References avail_data, avail_size_data, and post_alloc_local().

Referenced by ojph::local::codeblock::finalize_alloc(), ojph::local::resolution::finalize_alloc(), ojph::local::subband::finalize_alloc(), and ojph::local::tile::finalize_alloc().

## ◆ post_alloc_local()

template<typename T, int N>

T * ojph::mem_fixed_allocator::post_alloc_local | ( | size_t | num_ele,
|  | ui32 | pre_size,
|  | size_t & | avail_sz,
|  | void *& | avail_p )
| inlineprivate

Definition at line 138 of file ojph_mem.h.

References ojph::align_ptr(), ojph::calc_aligned_size(), and preallocation.

Referenced by post_alloc_data(), and post_alloc_obj().

## ◆ post_alloc_obj()

template<typename T>

T * ojph::mem_fixed_allocator::post_alloc_obj | ( | size_t | num_ele | ) |
| inline

Definition at line 119 of file ojph_mem.h.

References avail_obj, avail_size_obj, and post_alloc_local().

Referenced by ojph::local::resolution::finalize_alloc(), ojph::local::subband::finalize_alloc(), ojph::local::tile::finalize_alloc(), and ojph::local::tile_comp::finalize_alloc().

## ◆ pre_alloc_data()

template<typename T>

void ojph::mem_fixed_allocator::pre_alloc_data | ( | size_t | num_ele,
|  | ui32 | pre_size )
| inline

Definition at line 72 of file ojph_mem.h.

References pre_alloc_local(), and size_data.

Referenced by ojph::local::codeblock::pre_alloc(), ojph::local::resolution::pre_alloc(), ojph::local::subband::pre_alloc(), and ojph::local::tile::pre_alloc().

## ◆ pre_alloc_local()

template<typename T, int N>

void ojph::mem_fixed_allocator::pre_alloc_local | ( | size_t | num_ele,
|  | ui32 | pre_size,
|  | size_t & | sz )
| inlineprivate

Definition at line 127 of file ojph_mem.h.

References ojph::calc_aligned_size(), and preallocation.

Referenced by pre_alloc_data(), and pre_alloc_obj().

## ◆ pre_alloc_obj()

template<typename T>

void ojph::mem_fixed_allocator::pre_alloc_obj | ( | size_t | num_ele | ) |
| inline

Definition at line 78 of file ojph_mem.h.

References pre_alloc_local(), and size_obj.

Referenced by ojph::local::resolution::pre_alloc(), ojph::local::subband::pre_alloc(), ojph::local::tile::pre_alloc(), and ojph::local::tile_comp::pre_alloc().

## ◆ restart()

void ojph::mem_fixed_allocator::restart | ( |  | ) |
| inline

Definition at line 104 of file ojph_mem.h.

References avail_data, avail_obj, avail_size_data, avail_size_obj, preallocation, size_data, and size_obj.

Referenced by mem_fixed_allocator().

## Member Data Documentation

## ◆ allocated_data

size_t ojph::mem_fixed_allocator::allocated_data
| private

Definition at line 155 of file ojph_mem.h.

Referenced by alloc(), and mem_fixed_allocator().

## ◆ avail_data

void * ojph::mem_fixed_allocator::avail_data
| private

Definition at line 153 of file ojph_mem.h.

Referenced by alloc(), post_alloc_data(), and restart().

## ◆ avail_obj

void * ojph::mem_fixed_allocator::avail_obj
| private

Definition at line 153 of file ojph_mem.h.

Referenced by alloc(), post_alloc_obj(), and restart().

## ◆ avail_size_data

size_t ojph::mem_fixed_allocator::avail_size_data
| private

Definition at line 154 of file ojph_mem.h.

Referenced by alloc(), post_alloc_data(), and restart().

## ◆ avail_size_obj

size_t ojph::mem_fixed_allocator::avail_size_obj
| private

Definition at line 154 of file ojph_mem.h.

Referenced by alloc(), post_alloc_obj(), and restart().

## ◆ preallocation

bool ojph::mem_fixed_allocator::preallocation
| private

Definition at line 156 of file ojph_mem.h.

Referenced by alloc(), post_alloc_local(), pre_alloc_local(), and restart().

## ◆ size_data

size_t ojph::mem_fixed_allocator::size_data
| private

Definition at line 154 of file ojph_mem.h.

Referenced by alloc(), pre_alloc_data(), and restart().

## ◆ size_obj

size_t ojph::mem_fixed_allocator::size_obj
| private

Definition at line 154 of file ojph_mem.h.

Referenced by alloc(), pre_alloc_obj(), and restart().

## ◆ store

void* ojph::mem_fixed_allocator::store
| private

Definition at line 153 of file ojph_mem.h.

Referenced by alloc(), mem_fixed_allocator(), and ~mem_fixed_allocator().

The documentation for this class was generated from the following file:

- /build/openjph/src/OpenJPH/src/core/openjph/ojph_mem.h