40#include FT_INTERNAL_DEBUG_H
65 arrstack->error =
error;
66 arrstack->sizeItem = sizeItem;
67 arrstack->allocated = 0;
70 arrstack->totalSize = 0;
83 arrstack->allocated = 0;
85 arrstack->totalSize = 0;
104 size_t newSize = numElements * arrstack->sizeItem;
107 if ( numElements >
FT_LONG_MAX / arrstack->sizeItem )
113 if ( !
FT_REALLOC( arrstack->ptr, arrstack->totalSize, newSize ) )
115 arrstack->allocated = numElements;
116 arrstack->totalSize = newSize;
118 if ( arrstack->count > numElements )
122 arrstack->count = numElements;
145 if ( numElements > arrstack->allocated )
152 arrstack->count = numElements;
172 return arrstack->count;
181 return arrstack->ptr;
195 if (
idx >= arrstack->count )
202 newPtr = (
FT_Byte*)arrstack->ptr +
idx * arrstack->sizeItem;
217 if ( arrstack->count == arrstack->allocated )
221 arrstack, arrstack->allocated + arrstack->chunk ) )
231 size_t offset = arrstack->count * arrstack->sizeItem;
236 arrstack->count += 1;
#define FT_ASSERT(condition)
#define FT_REALLOC(ptr, cursz, newsz)
#define FT_MEM_COPY(dest, source, count)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
FT_BEGIN_HEADER typedef unsigned char FT_Bool
static char memory[1024 *256]
cf2_arrstack_getPointer(const CF2_ArrStack arrstack, size_t idx)
cf2_arrstack_setCount(CF2_ArrStack arrstack, size_t numElements)
cf2_arrstack_push(CF2_ArrStack arrstack, const void *ptr)
cf2_arrstack_finalize(CF2_ArrStack arrstack)
cf2_arrstack_init(CF2_ArrStack arrstack, FT_Memory memory, FT_Error *error, size_t sizeItem)
cf2_arrstack_getBuffer(const CF2_ArrStack arrstack)
cf2_arrstack_clear(CF2_ArrStack arrstack)
cf2_arrstack_size(const CF2_ArrStack arrstack)
static FT_Bool cf2_arrstack_setNumElements(CF2_ArrStack arrstack, size_t numElements)
FT_BEGIN_HEADER struct CF2_ArrStackRec_ * CF2_ArrStack
#define CF2_SET_ERROR(error, e)