PFMultiplayerSetMemoryCallbacks
Optionally configures the memory allocation and freeing callbacks the Multiplayer library should use.
Syntax
HRESULT PFMultiplayerSetMemoryCallbacks(
PFMultiplayerAllocateMemoryCallback allocateMemoryCallback,
PFMultiplayerFreeMemoryCallback freeMemoryCallback
)
Parameters
allocateMemoryCallback
PFMultiplayerAllocateMemoryCallback
A pointer to the custom allocation callback to use.
freeMemoryCallback
PFMultiplayerFreeMemoryCallback
A pointer to the custom freeing callback to use.
Return value
Type: HRESULT
S_OK
if the call succeeded or an error code otherwise. The human-readable form of the error code can be retrieved via PFMultiplayerGetErrorMessage().
Remarks
This method allows the title to install custom memory allocation functions in order to service all requests by the Multiplayer library for new memory buffers instead of using its default allocation functions.
The allocateMemoryCallback
and freeMemoryCallback
parameters must both be non-null.
To use this method, it must be called before any other Multiplayer method. This method cannot be called again for the lifetime of this process.
Requirements
Header: PFMultiplayer.h
See also
PFMultiplayer members
PFMultiplayerAllocateMemoryCallback
PFMultiplayerFreeMemoryCallback
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應