[#CRYPTO_alloc_ex_data]
= CRYPTO&lowbar;alloc&lowbar;ex&lowbar;data
:mrdocs:

Allocate ex&lowbar;data at index `idx` by invoking the registered new callback if unset&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
CRYPTO&lowbar;alloc&lowbar;ex&lowbar;data(
    int class&lowbar;index,
    void* obj,
    xref:CRYPTO_EX_DATA.adoc[CRYPTO&lowbar;EX&lowbar;DATA]* ad,
    int idx);
----

== Return Value

1 on success (including when a value is already present), or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *class&lowbar;index*
| CRYPTO&lowbar;EX&lowbar;INDEX&lowbar;&ast; identifying the object class&period;
| *obj*
| Object that owns `ad` (passed to the new callback)&period;
| *ad*
| Ex&hyphen;data table to allocate into&period;
| *idx*
| Index from CRYPTO&lowbar;get&lowbar;ex&lowbar;new&lowbar;index() (or a class helper)&period;
|===


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