Mistake on this page?
Report an issue in GitHub or email us
QCBORStringAllocator Struct Reference

This is a set of functions and pointer context (in object-oriented parlance, an "object") used to allocate memory for coalescing the segments of an indefinite length string into one. More...

#include <qcbor.h>

Detailed Description

This is a set of functions and pointer context (in object-oriented parlance, an "object") used to allocate memory for coalescing the segments of an indefinite length string into one.

The fAllocate function works as an initial allocator and a reallocator to expand the string for each new segment. When it is an initial allocator pOldMem is NULL.

The fFree function is called to clean up an individual allocation when an error occurs.

The fDesctructor function is called when QCBORDecode_Finish is called.

Any memory allocated with this will be marked by setting uDataAlloc or uLabelAlloc in the QCBORItem structure so the caller knows they have to free it.

fAllocate is only ever called to increase the single most recent allocation made, making implementation of a memory pool very simple.

fFree is also only called on the single most recent allocation.

Definition at line 784 of file qcbor.h.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.