httpmessage  0.4.0
HTTP message parsing library
All Classes Files Functions Variables Enumerations Enumerator Macros Modules Pages
Memory management

By default, httpmessage library does not allocates any memory to store text chunks. It only creates descriptor structures that point to text memory block allocated elsewhere.

Allocation and deallocation functions usage

Stack allocation

/* Declare and initialize members */
struct httpmessage_request descriptor;
/* ... processing ... */
/* Free memory allocated durring processing */
httpmessage_request_clear (&descriptor, 0);

Heap allocation with dynamic internal storage

/* ... processing ... */

Heap allocation with pre-allocated storage

/* ... processing ...
httpmessage_request_consume(descriptor, ..., option_flags);
*/
free (descriptor);