refc_binary.h

Include dependency graph for refc_binary.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "2" [label="stdbool.h" tooltip="stdbool.h"]
    "8" [label="assert.h" tooltip="assert.h"]
    "11" [label="stdint.h" tooltip="stdint.h"]
    "3" [label="stdlib.h" tooltip="stdlib.h"]
    "13" [label="utils.h" tooltip="utils.h"]
    "7" [label="term_typedef.h" tooltip="term_typedef.h"]
    "14" [label="stddef.h" tooltip="stddef.h"]
    "9" [label="limits.h" tooltip="limits.h"]
    "1" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/refc_binary.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/refc_binary.h" fillcolor="#BFBFBF"]
    "6" [label="erl_nif.h" tooltip="erl_nif.h"]
    "5" [label="resources.h" tooltip="resources.h"]
    "12" [label="memory.h" tooltip="memory.h"]
    "10" [label="inttypes.h" tooltip="inttypes.h"]
    "4" [label="list.h" tooltip="list.h"]
    "13" -> "14" [dir=forward tooltip="include"]
    "7" -> "8" [dir=forward tooltip="include"]
    "7" -> "9" [dir=forward tooltip="include"]
    "7" -> "10" [dir=forward tooltip="include"]
    "7" -> "11" [dir=forward tooltip="include"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "3" [dir=forward tooltip="include"]
    "1" -> "4" [dir=forward tooltip="include"]
    "1" -> "5" [dir=forward tooltip="include"]
    "6" -> "7" [dir=forward tooltip="include"]
    "5" -> "3" [dir=forward tooltip="include"]
    "5" -> "6" [dir=forward tooltip="include"]
    "5" -> "4" [dir=forward tooltip="include"]
    "5" -> "12" [dir=forward tooltip="include"]
    "12" -> "6" [dir=forward tooltip="include"]
    "12" -> "7" [dir=forward tooltip="include"]
    "12" -> "13" [dir=forward tooltip="include"]
    "12" -> "11" [dir=forward tooltip="include"]
    "12" -> "3" [dir=forward tooltip="include"]
}

This graph shows which files directly or indirectly include refc_binary.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "16" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bif.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bif.c"]
    "44" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/dictionary.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/dictionary.c"]
    "15" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bif.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bif.h"]
    "45" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/dictionary.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/dictionary.h"]
    "9" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bitstring.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bitstring.c"]
    "8" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bitstring.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bitstring.h"]
    "31" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/platform_nifs.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/platform_nifs.h"]
    "23" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/posix_nifs.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/posix_nifs.c"]
    "47" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/posix_nifs.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/posix_nifs.h"]
    "53" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/defaultatoms.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/defaultatoms.c"]
    "52" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/defaultatoms.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/defaultatoms.h"]
    "26" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/inet.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/inet.c"]
    "25" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/inet.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/inet.h"]
    "20" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/scheduler.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/scheduler.c"]
    "42" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/scheduler.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/scheduler.h"]
    "46" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/exportedfunction.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/exportedfunction.h"]
    "13" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/context.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/context.c"]
    "14" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/context.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/context.h"]
    "40" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/port.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/port.c"]
    "41" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/port.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/port.h"]
    "54" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/overflow_helpers.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/overflow_helpers.h"]
    "33" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/stacktrace.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/stacktrace.c"]
    "32" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/stacktrace.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/stacktrace.h"]
    "5" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/refc_binary.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/refc_binary.c"]
    "1" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/refc_binary.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/refc_binary.h" fillcolor="#BFBFBF"]
    "43" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/mailbox.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/mailbox.c"]
    "17" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/module.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/module.c"]
    "30" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/module.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/module.h"]
    "51" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/avmpack.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/avmpack.c"]
    "50" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/avmpack.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/avmpack.h"]
    "29" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/term.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/term.c"]
    "7" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/term.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/term.h"]
    "11" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/interop.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/interop.c"]
    "4" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_ssl.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_ssl.c"]
    "24" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/interop.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/interop.h"]
    "39" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_ssl.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_ssl.h"]
    "6" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/resources.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/resources.c"]
    "28" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_crypto.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_crypto.c"]
    "36" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_crypto.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_crypto.h"]
    "27" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_net.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_net.c"]
    "37" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_net.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_net.h"]
    "21" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/erl_nif_priv.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/erl_nif_priv.h"]
    "34" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/sys.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/sys.h"]
    "12" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/nifs.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/nifs.c"]
    "35" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/nifs.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/nifs.h"]
    "19" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/debug.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/debug.c"]
    "18" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/debug.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/debug.h"]
    "2" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/globalcontext.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/globalcontext.c"]
    "49" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/globalcontext.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/globalcontext.h"]
    "3" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/memory.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/memory.c"]
    "22" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_socket.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_socket.c"]
    "38" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_socket.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_socket.h"]
    "10" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/externalterm.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/externalterm.c"]
    "48" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/externalterm.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/externalterm.h"]
    "15" -> "16" [dir=back tooltip="include"]
    "15" -> "17" [dir=back tooltip="include"]
    "15" -> "12" [dir=back tooltip="include"]
    "45" -> "16" [dir=back tooltip="include"]
    "45" -> "13" [dir=back tooltip="include"]
    "45" -> "44" [dir=back tooltip="include"]
    "45" -> "3" [dir=back tooltip="include"]
    "45" -> "12" [dir=back tooltip="include"]
    "45" -> "22" [dir=back tooltip="include"]
    "45" -> "5" [dir=back tooltip="include"]
    "8" -> "9" [dir=back tooltip="include"]
    "8" -> "10" [dir=back tooltip="include"]
    "8" -> "11" [dir=back tooltip="include"]
    "8" -> "12" [dir=back tooltip="include"]
    "31" -> "12" [dir=back tooltip="include"]
    "47" -> "2" [dir=back tooltip="include"]
    "47" -> "12" [dir=back tooltip="include"]
    "47" -> "22" [dir=back tooltip="include"]
    "47" -> "23" [dir=back tooltip="include"]
    "52" -> "16" [dir=back tooltip="include"]
    "52" -> "53" [dir=back tooltip="include"]
    "52" -> "44" [dir=back tooltip="include"]
    "52" -> "2" [dir=back tooltip="include"]
    "52" -> "11" [dir=back tooltip="include"]
    "52" -> "12" [dir=back tooltip="include"]
    "52" -> "28" [dir=back tooltip="include"]
    "52" -> "27" [dir=back tooltip="include"]
    "52" -> "22" [dir=back tooltip="include"]
    "52" -> "4" [dir=back tooltip="include"]
    "52" -> "40" [dir=back tooltip="include"]
    "52" -> "41" [dir=back tooltip="include"]
    "52" -> "23" [dir=back tooltip="include"]
    "52" -> "6" [dir=back tooltip="include"]
    "52" -> "33" [dir=back tooltip="include"]
    "25" -> "26" [dir=back tooltip="include"]
    "25" -> "27" [dir=back tooltip="include"]
    "25" -> "22" [dir=back tooltip="include"]
    "25" -> "4" [dir=back tooltip="include"]
    "42" -> "2" [dir=back tooltip="include"]
    "42" -> "43" [dir=back tooltip="include"]
    "42" -> "12" [dir=back tooltip="include"]
    "42" -> "22" [dir=back tooltip="include"]
    "42" -> "20" [dir=back tooltip="include"]
    "46" -> "15" [dir=back tooltip="include"]
    "46" -> "30" [dir=back tooltip="include"]
    "46" -> "35" [dir=back tooltip="include"]
    "46" -> "31" [dir=back tooltip="include"]
    "46" -> "47" [dir=back tooltip="include"]
    "14" -> "15" [dir=back tooltip="include"]
    "14" -> "13" [dir=back tooltip="include"]
    "14" -> "18" [dir=back tooltip="include"]
    "14" -> "21" [dir=back tooltip="include"]
    "14" -> "10" [dir=back tooltip="include"]
    "14" -> "2" [dir=back tooltip="include"]
    "14" -> "24" [dir=back tooltip="include"]
    "14" -> "3" [dir=back tooltip="include"]
    "14" -> "17" [dir=back tooltip="include"]
    "14" -> "30" [dir=back tooltip="include"]
    "14" -> "12" [dir=back tooltip="include"]
    "14" -> "35" [dir=back tooltip="include"]
    "14" -> "28" [dir=back tooltip="include"]
    "14" -> "27" [dir=back tooltip="include"]
    "14" -> "22" [dir=back tooltip="include"]
    "14" -> "4" [dir=back tooltip="include"]
    "14" -> "40" [dir=back tooltip="include"]
    "14" -> "41" [dir=back tooltip="include"]
    "14" -> "5" [dir=back tooltip="include"]
    "14" -> "6" [dir=back tooltip="include"]
    "14" -> "42" [dir=back tooltip="include"]
    "14" -> "32" [dir=back tooltip="include"]
    "14" -> "29" [dir=back tooltip="include"]
    "41" -> "26" [dir=back tooltip="include"]
    "41" -> "12" [dir=back tooltip="include"]
    "41" -> "27" [dir=back tooltip="include"]
    "41" -> "22" [dir=back tooltip="include"]
    "41" -> "4" [dir=back tooltip="include"]
    "41" -> "40" [dir=back tooltip="include"]
    "54" -> "16" [dir=back tooltip="include"]
    "32" -> "33" [dir=back tooltip="include"]
    "1" -> "2" [dir=back tooltip="include"]
    "1" -> "3" [dir=back tooltip="include"]
    "1" -> "4" [dir=back tooltip="include"]
    "1" -> "5" [dir=back tooltip="include"]
    "1" -> "6" [dir=back tooltip="include"]
    "1" -> "7" [dir=back tooltip="include"]
    "30" -> "15" [dir=back tooltip="include"]
    "30" -> "17" [dir=back tooltip="include"]
    "30" -> "12" [dir=back tooltip="include"]
    "30" -> "31" [dir=back tooltip="include"]
    "30" -> "32" [dir=back tooltip="include"]
    "30" -> "34" [dir=back tooltip="include"]
    "50" -> "51" [dir=back tooltip="include"]
    "50" -> "2" [dir=back tooltip="include"]
    "50" -> "12" [dir=back tooltip="include"]
    "7" -> "8" [dir=back tooltip="include"]
    "7" -> "13" [dir=back tooltip="include"]
    "7" -> "14" [dir=back tooltip="include"]
    "7" -> "44" [dir=back tooltip="include"]
    "7" -> "45" [dir=back tooltip="include"]
    "7" -> "46" [dir=back tooltip="include"]
    "7" -> "48" [dir=back tooltip="include"]
    "7" -> "49" [dir=back tooltip="include"]
    "7" -> "26" [dir=back tooltip="include"]
    "7" -> "11" [dir=back tooltip="include"]
    "7" -> "24" [dir=back tooltip="include"]
    "7" -> "3" [dir=back tooltip="include"]
    "7" -> "17" [dir=back tooltip="include"]
    "7" -> "30" [dir=back tooltip="include"]
    "7" -> "12" [dir=back tooltip="include"]
    "7" -> "28" [dir=back tooltip="include"]
    "7" -> "27" [dir=back tooltip="include"]
    "7" -> "22" [dir=back tooltip="include"]
    "7" -> "4" [dir=back tooltip="include"]
    "7" -> "54" [dir=back tooltip="include"]
    "7" -> "41" [dir=back tooltip="include"]
    "7" -> "47" [dir=back tooltip="include"]
    "7" -> "32" [dir=back tooltip="include"]
    "7" -> "29" [dir=back tooltip="include"]
    "24" -> "25" [dir=back tooltip="include"]
    "24" -> "11" [dir=back tooltip="include"]
    "24" -> "12" [dir=back tooltip="include"]
    "24" -> "28" [dir=back tooltip="include"]
    "24" -> "27" [dir=back tooltip="include"]
    "24" -> "22" [dir=back tooltip="include"]
    "24" -> "4" [dir=back tooltip="include"]
    "24" -> "23" [dir=back tooltip="include"]
    "24" -> "29" [dir=back tooltip="include"]
    "39" -> "4" [dir=back tooltip="include"]
    "36" -> "28" [dir=back tooltip="include"]
    "37" -> "27" [dir=back tooltip="include"]
    "21" -> "13" [dir=back tooltip="include"]
    "21" -> "2" [dir=back tooltip="include"]
    "21" -> "3" [dir=back tooltip="include"]
    "21" -> "22" [dir=back tooltip="include"]
    "21" -> "4" [dir=back tooltip="include"]
    "21" -> "23" [dir=back tooltip="include"]
    "21" -> "5" [dir=back tooltip="include"]
    "21" -> "6" [dir=back tooltip="include"]
    "34" -> "13" [dir=back tooltip="include"]
    "34" -> "2" [dir=back tooltip="include"]
    "34" -> "17" [dir=back tooltip="include"]
    "34" -> "12" [dir=back tooltip="include"]
    "34" -> "22" [dir=back tooltip="include"]
    "34" -> "6" [dir=back tooltip="include"]
    "34" -> "20" [dir=back tooltip="include"]
    "35" -> "17" [dir=back tooltip="include"]
    "35" -> "12" [dir=back tooltip="include"]
    "35" -> "28" [dir=back tooltip="include"]
    "35" -> "36" [dir=back tooltip="include"]
    "35" -> "27" [dir=back tooltip="include"]
    "35" -> "37" [dir=back tooltip="include"]
    "35" -> "22" [dir=back tooltip="include"]
    "35" -> "38" [dir=back tooltip="include"]
    "35" -> "4" [dir=back tooltip="include"]
    "35" -> "39" [dir=back tooltip="include"]
    "35" -> "23" [dir=back tooltip="include"]
    "18" -> "19" [dir=back tooltip="include"]
    "18" -> "3" [dir=back tooltip="include"]
    "18" -> "20" [dir=back tooltip="include"]
    "49" -> "50" [dir=back tooltip="include"]
    "49" -> "13" [dir=back tooltip="include"]
    "49" -> "14" [dir=back tooltip="include"]
    "49" -> "52" [dir=back tooltip="include"]
    "49" -> "2" [dir=back tooltip="include"]
    "49" -> "3" [dir=back tooltip="include"]
    "49" -> "17" [dir=back tooltip="include"]
    "49" -> "30" [dir=back tooltip="include"]
    "49" -> "12" [dir=back tooltip="include"]
    "49" -> "28" [dir=back tooltip="include"]
    "49" -> "27" [dir=back tooltip="include"]
    "49" -> "37" [dir=back tooltip="include"]
    "49" -> "22" [dir=back tooltip="include"]
    "49" -> "38" [dir=back tooltip="include"]
    "49" -> "4" [dir=back tooltip="include"]
    "49" -> "39" [dir=back tooltip="include"]
    "49" -> "40" [dir=back tooltip="include"]
    "49" -> "41" [dir=back tooltip="include"]
    "49" -> "23" [dir=back tooltip="include"]
    "49" -> "47" [dir=back tooltip="include"]
    "49" -> "42" [dir=back tooltip="include"]
    "49" -> "33" [dir=back tooltip="include"]
    "49" -> "34" [dir=back tooltip="include"]
    "38" -> "22" [dir=back tooltip="include"]
    "38" -> "4" [dir=back tooltip="include"]
    "48" -> "10" [dir=back tooltip="include"]
    "48" -> "17" [dir=back tooltip="include"]
    "48" -> "12" [dir=back tooltip="include"]
}

Defines

ATOMIC
TYPEDEF_CONTEXT
TYPEDEF_GLOBALCONTEXT

Typedefs

typedef struct Context Context
typedef struct GlobalContext GlobalContext

Functions

struct RefcBinary *refc_binary_create_resource(size_t size, struct ResourceType *resource_type)

Create a reference-counted resource object outside of the process heap.

This function will create a reference-counted resource object outside of the context heap. A blob will be allocated in the VM memory (e.g., via malloc). The allocated data will include an internal data structure that includes the data size and reference count.

Parameters:
  • size – the size of the data to create

  • resource_type – the resource type, NULL for regular refc binaries.

Returns:

a pointer to the out-of-context data.

static inline struct RefcBinary *refc_binary_create_refc(size_t size)

Create a reference-counted binary outside of the process heap.

This function will create a reference-counted binary outside of the context heap. A blob will be allocated in the VM memory (e.g., via malloc). The allocated data will include an internal data structure that includes the data size and reference count.

Parameters:
  • size – the size of the data to create

Returns:

a pointer to the out-of-context data.

const char *refc_binary_get_data(const struct RefcBinary *ptr)

get the data of the off-context binary

Return the data of the off-context binary

Parameters:
  • ptr – Refc binary returned from memory_create_refc_binary

struct RefcBinary *refc_binary_from_data(void *ptr)

get the refc binary from its pointer

This must only be passed the result of refc_binary_get_data.

Parameters:
  • ptr – pointer obtained from refc_binary_get_data

void refc_binary_increment_refcount(struct RefcBinary *ptr)

Increment the reference count on the refc binary.

Parameters:
  • ptr – the refc binary

bool refc_binary_decrement_refcount(struct RefcBinary *ptr, GlobalContext *global)

Decrement the reference count on the refc binary.

This function will call refc_binary_destroy if the reference count reaches 0.

Parameters:
  • ptr – the refc binary

  • global – the global context

Returns:

true if the refc binary was free’d; false, otherwise

void refc_binary_destroy(struct RefcBinary *refc, struct GlobalContext *global)

Destroy a refc binary after its reference count reached 0.

This function will call the destructor if the refc binary is a resource and will free the refc binary.

Parameters:
  • refc – the binary to destroy

  • global – the global context

term refc_binary_create_binary_info(Context *ctx)

TODO consider implementing erlang:memory/0,1 instead

size_t refc_binary_total_size(Context *ctx)

Return the total size (in bytes) of all reference counted binaries.

Returns:

the total size (in bytes) of all reference counted binaries

struct RefcBinary
#include <refc_binary.h>

Collaboration diagram for RefcBinary:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "15" [label="SpinLock" tooltip="SpinLock"]
    "2" [label="ResourceType" tooltip="ResourceType"]
    "9" [label="Module" tooltip="Module"]
    "8" [label="ListHead" tooltip="ListHead"]
    "3" [label="GlobalContext" tooltip="GlobalContext"]
    "11" [label="ModuleFilename" tooltip="ModuleFilename"]
    "6" [label="HNodeGroup" tooltip="HNodeGroup"]
    "14" [label="TimerList" tooltip="TimerList"]
    "12" [label="LiteralEntry" tooltip="LiteralEntry"]
    "13" [label="AtomsHashTable" tooltip="AtomsHashTable"]
    "1" [label="RefcBinary" tooltip="RefcBinary" fillcolor="#BFBFBF"]
    "4" [label="AtomTable" tooltip="AtomTable"]
    "10" [label="ExportedFunction" tooltip="ExportedFunction"]
    "7" [label="SyncList" tooltip="SyncList"]
    "5" [label="HNode" tooltip="HNode"]
    "2" -> "3" [dir=forward tooltip="usage"]
    "2" -> "8" [dir=forward tooltip="usage"]
    "9" -> "10" [dir=forward tooltip="usage"]
    "9" -> "11" [dir=forward tooltip="usage"]
    "9" -> "12" [dir=forward tooltip="usage"]
    "9" -> "8" [dir=forward tooltip="usage"]
    "8" -> "8" [dir=forward tooltip="usage"]
    "3" -> "4" [dir=forward tooltip="usage"]
    "3" -> "7" [dir=forward tooltip="usage"]
    "3" -> "9" [dir=forward tooltip="usage"]
    "3" -> "13" [dir=forward tooltip="usage"]
    "3" -> "14" [dir=forward tooltip="usage"]
    "3" -> "15" [dir=forward tooltip="usage"]
    "3" -> "8" [dir=forward tooltip="usage"]
    "6" -> "5" [dir=forward tooltip="usage"]
    "6" -> "6" [dir=forward tooltip="usage"]
    "14" -> "8" [dir=forward tooltip="usage"]
    "13" -> "5" [dir=forward tooltip="usage"]
    "1" -> "2" [dir=forward tooltip="usage"]
    "1" -> "8" [dir=forward tooltip="usage"]
    "4" -> "5" [dir=forward tooltip="usage"]
    "4" -> "6" [dir=forward tooltip="usage"]
    "7" -> "8" [dir=forward tooltip="usage"]
    "5" -> "5" [dir=forward tooltip="usage"]
}

Public Members

struct ListHead head
size_t ATOMIC ref_count
size_t size
struct ResourceType *resource_type
uint8_t data[]