resources.h

Include dependency graph for resources.h:

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

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

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "9" [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"]
    "17" [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"]
    "11" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bitstring.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bitstring.c"]
    "10" [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"]
    "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"]
    "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"]
    "15" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/context.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/context.c"]
    "16" [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"]
    "53" [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"]
    "6" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/refc_binary.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/refc_binary.c"]
    "3" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/refc_binary.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/refc_binary.h"]
    "43" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/mailbox.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/mailbox.c"]
    "18" [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"]
    "8" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/term.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/term.h"]
    "13" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/interop.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/interop.c"]
    "5" [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"]
    "7" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/resources.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/resources.c"]
    "1" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/resources.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/resources.h" fillcolor="#BFBFBF"]
    "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"]
    "14" [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"]
    "20" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/debug.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/debug.c"]
    "19" [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"]
    "4" [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"]
    "12" [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"]
    "17" -> "9" [dir=back tooltip="include"]
    "17" -> "18" [dir=back tooltip="include"]
    "17" -> "14" [dir=back tooltip="include"]
    "45" -> "9" [dir=back tooltip="include"]
    "45" -> "15" [dir=back tooltip="include"]
    "45" -> "44" [dir=back tooltip="include"]
    "45" -> "4" [dir=back tooltip="include"]
    "45" -> "14" [dir=back tooltip="include"]
    "45" -> "22" [dir=back tooltip="include"]
    "45" -> "6" [dir=back tooltip="include"]
    "10" -> "11" [dir=back tooltip="include"]
    "10" -> "12" [dir=back tooltip="include"]
    "10" -> "13" [dir=back tooltip="include"]
    "10" -> "14" [dir=back tooltip="include"]
    "31" -> "14" [dir=back tooltip="include"]
    "47" -> "2" [dir=back tooltip="include"]
    "47" -> "14" [dir=back tooltip="include"]
    "47" -> "22" [dir=back tooltip="include"]
    "47" -> "23" [dir=back tooltip="include"]
    "52" -> "9" [dir=back tooltip="include"]
    "52" -> "44" [dir=back tooltip="include"]
    "52" -> "2" [dir=back tooltip="include"]
    "52" -> "13" [dir=back tooltip="include"]
    "52" -> "14" [dir=back tooltip="include"]
    "52" -> "28" [dir=back tooltip="include"]
    "52" -> "27" [dir=back tooltip="include"]
    "52" -> "22" [dir=back tooltip="include"]
    "52" -> "5" [dir=back tooltip="include"]
    "52" -> "40" [dir=back tooltip="include"]
    "52" -> "41" [dir=back tooltip="include"]
    "52" -> "23" [dir=back tooltip="include"]
    "52" -> "7" [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" -> "5" [dir=back tooltip="include"]
    "42" -> "2" [dir=back tooltip="include"]
    "42" -> "43" [dir=back tooltip="include"]
    "42" -> "14" [dir=back tooltip="include"]
    "42" -> "22" [dir=back tooltip="include"]
    "46" -> "17" [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"]
    "16" -> "17" [dir=back tooltip="include"]
    "16" -> "15" [dir=back tooltip="include"]
    "16" -> "19" [dir=back tooltip="include"]
    "16" -> "21" [dir=back tooltip="include"]
    "16" -> "12" [dir=back tooltip="include"]
    "16" -> "2" [dir=back tooltip="include"]
    "16" -> "24" [dir=back tooltip="include"]
    "16" -> "4" [dir=back tooltip="include"]
    "16" -> "18" [dir=back tooltip="include"]
    "16" -> "30" [dir=back tooltip="include"]
    "16" -> "14" [dir=back tooltip="include"]
    "16" -> "35" [dir=back tooltip="include"]
    "16" -> "28" [dir=back tooltip="include"]
    "16" -> "27" [dir=back tooltip="include"]
    "16" -> "22" [dir=back tooltip="include"]
    "16" -> "5" [dir=back tooltip="include"]
    "16" -> "40" [dir=back tooltip="include"]
    "16" -> "41" [dir=back tooltip="include"]
    "16" -> "6" [dir=back tooltip="include"]
    "16" -> "7" [dir=back tooltip="include"]
    "16" -> "42" [dir=back tooltip="include"]
    "16" -> "32" [dir=back tooltip="include"]
    "16" -> "29" [dir=back tooltip="include"]
    "41" -> "26" [dir=back tooltip="include"]
    "41" -> "14" [dir=back tooltip="include"]
    "41" -> "27" [dir=back tooltip="include"]
    "41" -> "22" [dir=back tooltip="include"]
    "41" -> "5" [dir=back tooltip="include"]
    "41" -> "40" [dir=back tooltip="include"]
    "53" -> "9" [dir=back tooltip="include"]
    "32" -> "33" [dir=back tooltip="include"]
    "3" -> "2" [dir=back tooltip="include"]
    "3" -> "4" [dir=back tooltip="include"]
    "3" -> "5" [dir=back tooltip="include"]
    "3" -> "6" [dir=back tooltip="include"]
    "3" -> "7" [dir=back tooltip="include"]
    "3" -> "8" [dir=back tooltip="include"]
    "30" -> "17" [dir=back tooltip="include"]
    "30" -> "18" [dir=back tooltip="include"]
    "30" -> "14" [dir=back tooltip="include"]
    "30" -> "31" [dir=back tooltip="include"]
    "30" -> "32" [dir=back tooltip="include"]
    "30" -> "34" [dir=back tooltip="include"]
    "30" -> "29" [dir=back tooltip="include"]
    "50" -> "51" [dir=back tooltip="include"]
    "50" -> "2" [dir=back tooltip="include"]
    "50" -> "14" [dir=back tooltip="include"]
    "8" -> "9" [dir=back tooltip="include"]
    "8" -> "10" [dir=back tooltip="include"]
    "8" -> "15" [dir=back tooltip="include"]
    "8" -> "16" [dir=back tooltip="include"]
    "8" -> "44" [dir=back tooltip="include"]
    "8" -> "45" [dir=back tooltip="include"]
    "8" -> "46" [dir=back tooltip="include"]
    "8" -> "48" [dir=back tooltip="include"]
    "8" -> "49" [dir=back tooltip="include"]
    "8" -> "26" [dir=back tooltip="include"]
    "8" -> "13" [dir=back tooltip="include"]
    "8" -> "24" [dir=back tooltip="include"]
    "8" -> "4" [dir=back tooltip="include"]
    "8" -> "18" [dir=back tooltip="include"]
    "8" -> "30" [dir=back tooltip="include"]
    "8" -> "14" [dir=back tooltip="include"]
    "8" -> "28" [dir=back tooltip="include"]
    "8" -> "27" [dir=back tooltip="include"]
    "8" -> "22" [dir=back tooltip="include"]
    "8" -> "5" [dir=back tooltip="include"]
    "8" -> "53" [dir=back tooltip="include"]
    "8" -> "41" [dir=back tooltip="include"]
    "8" -> "47" [dir=back tooltip="include"]
    "8" -> "32" [dir=back tooltip="include"]
    "8" -> "29" [dir=back tooltip="include"]
    "24" -> "25" [dir=back tooltip="include"]
    "24" -> "13" [dir=back tooltip="include"]
    "24" -> "14" [dir=back tooltip="include"]
    "24" -> "28" [dir=back tooltip="include"]
    "24" -> "27" [dir=back tooltip="include"]
    "24" -> "22" [dir=back tooltip="include"]
    "24" -> "5" [dir=back tooltip="include"]
    "24" -> "23" [dir=back tooltip="include"]
    "24" -> "29" [dir=back tooltip="include"]
    "39" -> "5" [dir=back tooltip="include"]
    "1" -> "2" [dir=back tooltip="include"]
    "1" -> "3" [dir=back tooltip="include"]
    "1" -> "7" [dir=back tooltip="include"]
    "36" -> "28" [dir=back tooltip="include"]
    "37" -> "27" [dir=back tooltip="include"]
    "21" -> "15" [dir=back tooltip="include"]
    "21" -> "2" [dir=back tooltip="include"]
    "21" -> "4" [dir=back tooltip="include"]
    "21" -> "22" [dir=back tooltip="include"]
    "21" -> "5" [dir=back tooltip="include"]
    "21" -> "23" [dir=back tooltip="include"]
    "21" -> "6" [dir=back tooltip="include"]
    "21" -> "7" [dir=back tooltip="include"]
    "34" -> "15" [dir=back tooltip="include"]
    "34" -> "2" [dir=back tooltip="include"]
    "34" -> "18" [dir=back tooltip="include"]
    "34" -> "14" [dir=back tooltip="include"]
    "34" -> "22" [dir=back tooltip="include"]
    "34" -> "7" [dir=back tooltip="include"]
    "35" -> "18" [dir=back tooltip="include"]
    "35" -> "14" [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" -> "5" [dir=back tooltip="include"]
    "35" -> "39" [dir=back tooltip="include"]
    "35" -> "23" [dir=back tooltip="include"]
    "19" -> "20" [dir=back tooltip="include"]
    "19" -> "4" [dir=back tooltip="include"]
    "49" -> "50" [dir=back tooltip="include"]
    "49" -> "15" [dir=back tooltip="include"]
    "49" -> "16" [dir=back tooltip="include"]
    "49" -> "52" [dir=back tooltip="include"]
    "49" -> "2" [dir=back tooltip="include"]
    "49" -> "4" [dir=back tooltip="include"]
    "49" -> "18" [dir=back tooltip="include"]
    "49" -> "30" [dir=back tooltip="include"]
    "49" -> "14" [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" -> "5" [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" -> "5" [dir=back tooltip="include"]
    "48" -> "12" [dir=back tooltip="include"]
    "48" -> "18" [dir=back tooltip="include"]
    "48" -> "14" [dir=back tooltip="include"]
}

Private data structures for nif object resources.

Defines

TYPEDEF_GLOBALCONTEXT
SELECT_EVENT_NOTIFICATION_SIZE (TUPLE_SIZE(4) + REF_SIZE + TERM_BOXED_RESOURCE_SIZE)

Typedefs

typedef struct GlobalContext GlobalContext

Functions

static inline void resource_type_destroy(struct ResourceType *resource_type)
bool select_event_notify(ErlNifEvent event, bool is_read, bool is_write, GlobalContext *global)

Send a notification that an event was selected.

This function is called from sys_poll_events platform function if a select event was selected and the read or write flag was set. It modifies the select_event object so the notification is only sent once.

The function can also be called from a select task loop if AVM_SELECT_IN_TASK is defined.

It is not an error to call this function with an event that is not in the list.

This function calls sys_unregister_select_event.

Parameters:
  • event – the event to notify

  • is_read – if the event was selected for reading

  • is_write – if the event was selected for writing

  • global – the global context

Returns:

true if the event was found

void select_event_count_and_destroy_closed(struct ListHead *select_events, size_t *read, size_t *write, size_t *either, GlobalContext *global)

Count events available for reading and/or writing and destroy the events marked for close.

Convenience function that can be called by sys_poll_events and iterates on events to be closed and count them.

The function can also be called from a select task loop if AVM_SELECT_IN_TASK is defined.

Parameters:
  • select_events – list of events, with a write lock

  • read – on output number of events with read = 1, can be NULL

  • write – on output number of events with write = 1, can be NULL

  • either – on output number of events with either read = 1 or write = 1, can be NULL

  • global – the global context

void destroy_resource_monitors(struct RefcBinary *resource, GlobalContext *global)

Destroy monitors associated with a resource.

Parameters:
  • resource – resource to destroy monitors for

  • global – the global context

term select_event_make_notification(void *rsrc_obj, uint64_t ref_ticks, bool is_write, Heap *heap)

Build a select event notification.

Parameters:
  • rsrc_obj – the resource to build the notification for

  • ref_ticks – the reference or 0 if it’s undefined

  • is_write – if the notification is for a write or a read

  • heap – the heap to create the notification in, should have enough memory available (see SELECT_EVENT_NOTIFICATION_SIZE)

struct ResourceType
#include <resources.h>

Collaboration diagram for ResourceType:

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

A resource type.

we need a reference to the global context as enif_release_resource needs to access the synchronized list of refc_binaries

Public Members

struct ListHead head
const char *name
GlobalContext *global
struct ListHead monitors
ErlNifResourceDtor *dtor
ErlNifResourceStop *stop
ErlNifResourceDown *down
struct SelectEvent
#include <resources.h>

Collaboration diagram for SelectEvent:

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

A selectable event.

Public Members

struct ListHead head
ErlNifEvent event
struct RefcBinary *resource
bool read
bool write
bool close
int32_t local_pid
uint64_t ref_ticks