Memory Allocation and String Values

Cogent API and Utilities: Version 4.1
Prev | Chapter 2. Point Structure, Storage, and Manipulation | Next

# 2.4. Memory Allocation and String Values

String values for points are normally allocated on the heap. Some functions, notably `PT_PointCopyValue`, make this assumption and may free the string pointer or allocate space for a new value. This is not true for a point name. The programmer must control the memory associated with the point name in the `PT_stCPOINT` structure.

| Zeroing an entire point structue (ie. setting all field values to `0`) for points of type `PT_TYPE_STRING` will create a memory leak.

Prev | Home | Next
Accessing and Copying Point Values | Up | Interprocess Communication

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.