libpmemcto API version 1.0

The PMDK repository on GitHub is the ultimate source of information on PMDK from release 2.0! For all questions and to submit eventual issues please follow to that repository. The PMDK documentation collected here should be valid up to the 1.13.1 release but is maintained only on a best-effort basis and may not reflect the latest state of the art.

comment: <> (SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT) comment: <> (LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,) comment: <> (DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY) comment: <> (THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT) comment: <> ((INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE) comment: <> (OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.)

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
SEE ALSO

NAME

pmemcto_aligned_alloc - allocate aligned memory

SYNOPSIS

#include <libpmemcto.h>

void *pmemcto_aligned_alloc(PMEMctopool *pcp, size_t alignment, size_t size);

DESCRIPTION

The pmemcto_aligned_alloc() function provides the same semantics as aligned_alloc(3), but operates on the memory pool pcp instead of the process heap supplied by the system. It allocates size bytes from the memory pool and returns a pointer to the allocated memory. The memory is not zeroed. The memory address will be a multiple of alignment, which must be a power of two.

RETURN VALUE

On success, pmemcto_aligned_alloc() function returns a pointer to the allocated memory. If size is 0, then pmemcto_aligned_alloc() returns either NULL, or a unique pointer value that can later be successfully passed to pmemcto_free(3). If pmemcto_aligned_alloc() is unable to satisfy the allocation request, a NULL pointer is returned and errno is set appropriately.

ERRORS

EINVAL alignment was not a power of two.

ENOMEM Insufficient memory available to satisfy allocation request.

SEE ALSO

aligned_alloc(3), malloc(3), jemalloc(3), pmemcto_malloc(3), libpmemcto(7) and http://pmem.io

The contents of this web site and the associated GitHub repositories are BSD-licensed open source.