> ## 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.

# xcurl_global_init_mem

> xcurl_global_init_mem

# xcurl\_global\_init\_mem

Initializes XCurl with custom memory allocators.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
CURL_EXTERN CURLcode xcurl_global_init_mem(long flags,
    xcurl_alloc_memory_callback m,
    xcurl_free_memory_callback f,
    xcurl_realloc_memory_callback r,
    curl_strdup_callback s,
    xcurl_calloc_memory_callback c
)
```

<a id="parametersSection" />

### Parameters

*flags*   \_In\_\
Type: long

This parameter is ignored by XCurl.

*m*   \_In\_\
Type: xcurl\_alloc\_memory\_callback\*

malloc() replacement

*f*   \_In\_\
Type: xcurl\_free\_memory\_callback\*

free() replacement

*r*   \_In\_\
Type: xcurl\_realloc\_memory\_callback\*

realloc() replacement

*s*   \_In\_\
Type: curl\_strdup\_callback\*

strdup() replacement

*c*   \_In\_\
Type: xcurl\_calloc\_memory\_callback\*

calloc() replacement

<a id="retvalSection" />

### Return value

If this function returns a non-zero value, then something went wrong and you cannot use the other curl functions.

<a id="remarksSection" />

## Remarks

This function is identical to [curl\_global\_init\_mem](https://curl.haxx.se/libcurl/c/curl_global_init_mem.html), except that this version initializes XCurl with custom memory allocators.

XCurl relies on the Gaming Runtime, and therefore cannot be initialized until after you run [XGameRuntimeInitialize](/reference/system/xgameruntimeinit/functions/xgameruntimeuninitialize).

Wherever you would have included `curl.h` in your game code, you must replace it with `xcurl.h`.

<a id="requirementsSection" />

## Requirements

**Header:** XCurl.h

**Library:** xcurl.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

<a id="seealsoSection" />

## See also

[XCurl Overview](/build/console-features/networking/web-requests/intro-xcurl)\
[HTTP and Web Sockets](/build/console-features/networking/web-requests/http-networking)\
[curl](https://curl.se/)\
[xcurl\_global\_suspend](/reference/networking/xcurl/functions/xcurl_global_suspend)\
[xcurl\_global\_resume](/reference/networking/xcurl/functions/xcurl_global_resume)


## Related topics

- [xCurl overview](/build/console-features/networking/web-requests/intro-xcurl.md)
- [xcurl_global_resume](/reference/networking/xcurl/functions/xcurl_global_resume.md)
- [xcurl_global_suspend](/reference/networking/xcurl/functions/xcurl_global_suspend.md)
- [XblInitArgs](/reference/live/xsapi-c/xbox_live_global_c/structs/xblinitargs.md)
- [HCInitialize](/reference/live/httpclient/httpclient/functions/hcinitialize.md)
