APTR buf = hw_TrackedAlloc(int size, ULONG flags, STRPTR name);
hw_TrackedAlloc()
to allocate
a memory buffer that gets tracked by Hollywood. If you forget to free this
memory buffer, Hollywood will issue a warning before it terminates. In order
to be able to identify the memory buffer that hasn't been freed, you need
to provide a name for every memory buffer you allocate using hw_TrackedAlloc()
.
In case you forget to free a buffer, Hollywood will tell you its name so that
you can identify where in your code the allocation was made.
The following flags are currently supported by hw_TrackedAlloc()
:
HWMEMF_CLEAR:
hw_TrackedAlloc()
will clear the memory buffer with
zeros before returning control to your plugin.
In release versions of Hollywood this function does the same as malloc()
.
You need to use hw_TrackedFree() to free memory
allocated by hw_TrackedAlloc()
.
This function is thread-safe.
NULL
on error