Memory Allocation¶
Use After Effects for any memory allocations of significant size. For small allocations, you can use new and delete, but this is the exception, not the rule. In low-memory conditions (such as during RAM preview), it's very important that plug-ins deal gracefully with out-of-memory conditions, and not compete with After Effects for OS memory. By using our memory allocation functions, After Effects can know when to free cached images, to avoid memory swapping. Failing to use our functions for sizable allocations can cause lock-ups, crashes, and tech support calls. Don't do that.
If you're wrapping existing C++ classes, create a base class that implements new and delete for that class and derive from it. To overload the STL, we don't recommend you overload global new and delete. Instead provide an allocator as part of the template definition.
Handles passed to you by After Effects are locked for you before you're called, and unlocked once you return.
PF_HandleSuite1¶
Function |
Purpose |
Replaces |
---|---|---|
|
Allocates a new handle.
|
|
|
Locks a handle.
|
|
|
Unlocks a handle.
|
|
|
Frees a handle.
|
|
|
Returns the size, in bytes, of the reallocatable block whose handle is passed in.
|
|
|
Resizes a handle.
|
|