PK_MEMORY Functions   

<<< PK_DELTA Functions Chapters Application I/O Functions >>>

Contents

[back to top]


D.1 Introduction

This appendix contains the specifications of the Frustrum functions required for allocating and freeing memory, used when PK functions return variable length information. These functions are called by the PK functions PK_MEMORY_alloc and PK_MEMORY_free.

The functions should be type compatible with malloc and free in the standard C run-time library.

The section on Section 9.3, “Memory management” in the Parasolid Functional Description provides further information on the use of these functions.

The functions are allowed to long-jump out of Parasolid in case of an error, with the same restrictions and requirements as the user-registered error-handling function (see Chapter 119, “Error Handling”, of the Parasolid Functional Description manual).

D.1.1 Registering the memory management functions

The memory management functions must be registered with Parasolid by calling the function PK_MEMORY_register_callbacks. This function can be called before starting a Parasolid modelling session, or during a session whenever Parasolid’s internal PK memory is empty.

If the functions have not been registered, or either of the function pointers given to PK_MEMORY_register_callbacks is NULL, Parasolid defaults to using the appropriate function from the standard C run-time-library when the application calls PK_MEMORY_alloc or PK_MEMORY_free.

You can use PK_MEMORY_ask_callbacks to return pointers to the memory management functions currently registered with Parasolid.

D.1.2 Memory management functions that can be registered

This section lists the memory management functions that you can register during a Parasolid session.

 

Note: In the following list, the function names given are purely nominal, as the functions are registered by the call to PK_MEMORY_register_callbacks.

 

Function

Description

For more information

alloc_fn

Allocates a specified amount of memory required in bytes.

PK_MEMORY_alloc_f_t

free_fn

Frees previously allocated memory.

PK_MEMORY_free_f_t

 

[back to top]

<<< PK_DELTA Functions Chapters Application I/O Functions >>>