[#CRYPTO_set_mem_functions]
= CRYPTO&lowbar;set&lowbar;mem&lowbar;functions
:mrdocs:

Install process&hyphen;wide CRYPTO memory allocator callbacks (before first allocation)&period;

== Synopsis

Declared in `&lt;openssl&sol;crypto&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
CRYPTO&lowbar;set&lowbar;mem&lowbar;functions(
    xref:CRYPTO_malloc_fn.adoc[CRYPTO&lowbar;malloc&lowbar;fn] malloc&lowbar;fn,
    xref:CRYPTO_realloc_fn.adoc[CRYPTO&lowbar;realloc&lowbar;fn] realloc&lowbar;fn,
    xref:CRYPTO_free_fn.adoc[CRYPTO&lowbar;free&lowbar;fn] free&lowbar;fn);
----

== Return Value

1 on success, or 0 if allocators cannot be changed (already in use)&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *malloc&lowbar;fn*
| Replacement malloc, or NULL to leave the current malloc unchanged&period;
| *realloc&lowbar;fn*
| Replacement realloc, or NULL to leave the current realloc unchanged&period;
| *free&lowbar;fn*
| Replacement free, or NULL to leave the current free unchanged&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
