Risk-Aware Code Review: Auto Approve Low-Risk Changes
LiveReview LiveReview LiveReview - Free, Risk-Aware Code Review: Auto Approve Low-Risk Changes | Product Hunt LiveReview - Free, Risk-Aware Code Review: Auto Approve Low-Risk Changes | Product Hunt GitHub Install Now

We'd appreciate a star

pmem2_source_from_anon() - creates data source backed by anonymous memory pages

Description

       The  pmem2_source_from_anon() function instantiates a new structpmem2_source object describing an anony‐
       mous data source.  Mappings created using this function are not backed by any file and are  zero-initial‐
       ized.

       The  size  argument  for the function defines the length in bytes of the anonymous source, as returned by
       pmem2_source_size(3).  The application should set this value so that it’s greater than or  equal  to  the
       size of any mapping created with the anonymous source.

       The offset value for mapping is ignored.

Errors

       The pmem2_source_form_anon() can fail with the following errors:

       • -ENOMEM - in case of insufficient memory to allocate an instance of structpmem2_source.

Name

pmem2_source_from_anon() - creates data source backed by anonymous memory pages

Return Value

       The pmem2_source_from_anon() function returns 0 on success or a negative error code on failure.

See Also

errno(3), pmem2_config_set_length(3), pmem2_map_new(3), pmem2_source_size(3), pmem2_config_set_length(3),
       libpmem2(7) and <https://pmem.io>

Synopsis

              #include <libpmem2.h>

              int pmem2_source_from_anon(struct pmem2_source **src, size_t size);

See Also