formZ SDK | 5.0 API Reference | System | Runtime Library (FZRT) | Memory

# fz_mem_zone_incr_ptr_general

Description

Resize a block of memory based on data size. This will reallocate a memory block , if necessary, to hold the more data elements as specified by the increment. The function will reallocate in predefined block sizes to avoid memory fragmentation and improve performance. This function may increase the memory block by more than the requested increment. Each subsequent call to this function should pass the same pointer for the size parameter, as this contains the true allocated size. The parameter "last" contains the logical number of elements used in the pointer, this parameter should always be less than or equal to the "size" parameter.

Plugin Prototype

fzrt_error_td fz_mem_zone_incr_ptr_general(

fzrt_zone_ptr | zone_ptr,
fzrt_ptr * | ptr,
fzrt_int | data_size,
fzrt_int | last,
fzrt_int * | size,
fzrt_int | incr )

Parameters

zone_ptr [Input]

mem zone that pointer is a member of

ptr [Input]

pointer to memory of which to increase the size

data_size [Input]

the size of the data elements

last [Input]

Then number of data elements currently used in the memory block

size [Input, Result]

pointer to an integer. On input this is the current number of data elements the pointer can hold, on exit this is the updated number of elements the pointer could hold.

incr [Input]

the minimum number of data elements to increase the size

Returns

FZRT_NOERR on success, error ID otherwise.

Availability

5.0.0.0

See Also

Function Set

fz_fzrt_mem_fset

Defined in

fzrt_api.h