## The `upc_all_alloc`

#### Synopsis

        #include <upc.h>
        shared void *upc_all_alloc(size_t nblocks,
                                   size_t nbytes);

#### Description

The `upc_all_alloc` function allocates shared space compatible with the following declaration:

`shared [nbytes] char[nblocks * nbytes].`

The `upc_all_alloc` function returns the same pointer value on all threads. If nblocks*nbytes is zero, the result is a null pointer-to-shared.

The dynamic lifetime of an allocated object extends from the time any thread completes the call to `upc_all_alloc` until any thread has deallocated the object.

Terms, definitions, and symbols

Back to index of all UPC functions