> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PFMemSetFunctions

> Optionally sets the memory hook functions to allow callers to control route memory allocations to their own memory manager. This must be called before.

Optionally sets the memory hook functions to allow callers to control route memory allocations to their own memory manager. This must be called before PFInitialize() and can not be called again once memory hooks have been set. This method allows the application to install custom memory allocation routines in order to service all requests for new memory buffers instead of using default allocation routines.

## Syntax

```cpp theme={null}
HRESULT PFMemSetFunctions(  
    PFMemoryHooks* hooks  
)  
```

### Parameters

**`hooks`**   [PFMemoryHooks\*](/services/playfab/api-references/c/pfplatform/structs/pfmemoryhooks)

Custom memory hooks to be used by the SDK.

### Return value

Type: HRESULT

HRESULT return code for this API operation.

## Remarks

Must be called before PFInitialize.

## Requirements

**Header:** PFPlatform.h

## See also

[PFPlatform members](/services/playfab/api-references/c/pfplatform/pfplatform_members)


## Related topics

- [PFMemGetFunctions](/services/playfab/api-references/c/pfplatform/functions/pfmemgetfunctions.md)
- [SDK Lifecycle](/services/playfab/sdks/c/lifecycle.md)
- [Services C API overview - PFPlatform.h](/services/playfab/api-references/c/pfplatform/pfplatform_members.md)
- [Memory hooking](/services/playfab/sdks/c/memory.md)
- [HCMemSetFunctions](/reference/live/httpclient/httpclient/functions/hcmemsetfunctions.md)
