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"]
    "9" [label="list.h" tooltip="list.h"]
    "7" [label="inttypes.h" tooltip="inttypes.h"]
    "11" -> "12" [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" -> "3" [dir=forward tooltip="include"]
    "10" -> "4" [dir=forward tooltip="include"]
    "10" -> "11" [dir=forward tooltip="include"]
    "10" -> "8" [dir=forward tooltip="include"]
    "10" -> "2" [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"]
    "17" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bif.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bif.c"]
    "45" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/dictionary.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/dictionary.c"]
    "16" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bif.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bif.h"]
    "46" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/dictionary.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/dictionary.h"]
    "10" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bitstring.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bitstring.c"]
    "9" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bitstring.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/bitstring.h"]
    "32" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/platform_nifs.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/platform_nifs.h"]
    "24" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/posix_nifs.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/posix_nifs.c"]
    "48" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/posix_nifs.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/posix_nifs.h"]
    "54" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/defaultatoms.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/defaultatoms.c"]
    "53" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/defaultatoms.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/defaultatoms.h"]
    "27" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/inet.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/inet.c"]
    "26" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/inet.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/inet.h"]
    "21" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/scheduler.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/scheduler.c"]
    "43" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/scheduler.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/scheduler.h"]
    "47" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/exportedfunction.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/exportedfunction.h"]
    "14" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/context.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/context.c"]
    "15" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/context.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/context.h"]
    "41" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/port.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/port.c"]
    "42" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/port.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/port.h"]
    "55" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/overflow_helpers.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/overflow_helpers.h"]
    "34" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/stacktrace.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/stacktrace.c"]
    "33" [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"]
    "44" [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"]
    "31" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/module.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/module.h"]
    "52" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/avmpack.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/avmpack.c"]
    "51" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/avmpack.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/avmpack.h"]
    "30" [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"]
    "12" [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"]
    "25" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/interop.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/interop.h"]
    "40" [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"]
    "29" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_crypto.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_crypto.c"]
    "37" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_crypto.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_crypto.h"]
    "28" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_net.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_net.c"]
    "38" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_net.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_net.h"]
    "22" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/erl_nif_priv.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/erl_nif_priv.h"]
    "35" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/sys.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/sys.h"]
    "13" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/nifs.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/nifs.c"]
    "36" [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"]
    "50" [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"]
    "23" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_socket.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_socket.c"]
    "39" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_socket.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/otp_socket.h"]
    "11" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/externalterm.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/externalterm.c"]
    "49" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/externalterm.h" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/externalterm.h"]
    "16" -> "17" [dir=back tooltip="include"]
    "16" -> "18" [dir=back tooltip="include"]
    "16" -> "13" [dir=back tooltip="include"]
    "46" -> "17" [dir=back tooltip="include"]
    "46" -> "14" [dir=back tooltip="include"]
    "46" -> "45" [dir=back tooltip="include"]
    "46" -> "4" [dir=back tooltip="include"]
    "46" -> "13" [dir=back tooltip="include"]
    "46" -> "23" [dir=back tooltip="include"]
    "46" -> "6" [dir=back tooltip="include"]
    "9" -> "10" [dir=back tooltip="include"]
    "9" -> "11" [dir=back tooltip="include"]
    "9" -> "12" [dir=back tooltip="include"]
    "9" -> "13" [dir=back tooltip="include"]
    "32" -> "13" [dir=back tooltip="include"]
    "48" -> "2" [dir=back tooltip="include"]
    "48" -> "13" [dir=back tooltip="include"]
    "48" -> "23" [dir=back tooltip="include"]
    "48" -> "24" [dir=back tooltip="include"]
    "53" -> "17" [dir=back tooltip="include"]
    "53" -> "54" [dir=back tooltip="include"]
    "53" -> "45" [dir=back tooltip="include"]
    "53" -> "2" [dir=back tooltip="include"]
    "53" -> "12" [dir=back tooltip="include"]
    "53" -> "13" [dir=back tooltip="include"]
    "53" -> "29" [dir=back tooltip="include"]
    "53" -> "28" [dir=back tooltip="include"]
    "53" -> "23" [dir=back tooltip="include"]
    "53" -> "5" [dir=back tooltip="include"]
    "53" -> "41" [dir=back tooltip="include"]
    "53" -> "42" [dir=back tooltip="include"]
    "53" -> "24" [dir=back tooltip="include"]
    "53" -> "7" [dir=back tooltip="include"]
    "53" -> "34" [dir=back tooltip="include"]
    "26" -> "27" [dir=back tooltip="include"]
    "26" -> "28" [dir=back tooltip="include"]
    "26" -> "23" [dir=back tooltip="include"]
    "26" -> "5" [dir=back tooltip="include"]
    "43" -> "2" [dir=back tooltip="include"]
    "43" -> "44" [dir=back tooltip="include"]
    "43" -> "13" [dir=back tooltip="include"]
    "43" -> "23" [dir=back tooltip="include"]
    "43" -> "21" [dir=back tooltip="include"]
    "47" -> "16" [dir=back tooltip="include"]
    "47" -> "31" [dir=back tooltip="include"]
    "47" -> "36" [dir=back tooltip="include"]
    "47" -> "32" [dir=back tooltip="include"]
    "47" -> "48" [dir=back tooltip="include"]
    "15" -> "16" [dir=back tooltip="include"]
    "15" -> "14" [dir=back tooltip="include"]
    "15" -> "19" [dir=back tooltip="include"]
    "15" -> "22" [dir=back tooltip="include"]
    "15" -> "11" [dir=back tooltip="include"]
    "15" -> "2" [dir=back tooltip="include"]
    "15" -> "25" [dir=back tooltip="include"]
    "15" -> "4" [dir=back tooltip="include"]
    "15" -> "18" [dir=back tooltip="include"]
    "15" -> "31" [dir=back tooltip="include"]
    "15" -> "13" [dir=back tooltip="include"]
    "15" -> "36" [dir=back tooltip="include"]
    "15" -> "29" [dir=back tooltip="include"]
    "15" -> "28" [dir=back tooltip="include"]
    "15" -> "23" [dir=back tooltip="include"]
    "15" -> "5" [dir=back tooltip="include"]
    "15" -> "41" [dir=back tooltip="include"]
    "15" -> "42" [dir=back tooltip="include"]
    "15" -> "6" [dir=back tooltip="include"]
    "15" -> "7" [dir=back tooltip="include"]
    "15" -> "43" [dir=back tooltip="include"]
    "15" -> "33" [dir=back tooltip="include"]
    "15" -> "30" [dir=back tooltip="include"]
    "42" -> "27" [dir=back tooltip="include"]
    "42" -> "13" [dir=back tooltip="include"]
    "42" -> "28" [dir=back tooltip="include"]
    "42" -> "23" [dir=back tooltip="include"]
    "42" -> "5" [dir=back tooltip="include"]
    "42" -> "41" [dir=back tooltip="include"]
    "55" -> "17" [dir=back tooltip="include"]
    "33" -> "34" [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"]
    "31" -> "16" [dir=back tooltip="include"]
    "31" -> "18" [dir=back tooltip="include"]
    "31" -> "13" [dir=back tooltip="include"]
    "31" -> "32" [dir=back tooltip="include"]
    "31" -> "33" [dir=back tooltip="include"]
    "31" -> "35" [dir=back tooltip="include"]
    "51" -> "52" [dir=back tooltip="include"]
    "51" -> "2" [dir=back tooltip="include"]
    "51" -> "13" [dir=back tooltip="include"]
    "8" -> "9" [dir=back tooltip="include"]
    "8" -> "14" [dir=back tooltip="include"]
    "8" -> "15" [dir=back tooltip="include"]
    "8" -> "45" [dir=back tooltip="include"]
    "8" -> "46" [dir=back tooltip="include"]
    "8" -> "47" [dir=back tooltip="include"]
    "8" -> "49" [dir=back tooltip="include"]
    "8" -> "50" [dir=back tooltip="include"]
    "8" -> "27" [dir=back tooltip="include"]
    "8" -> "12" [dir=back tooltip="include"]
    "8" -> "25" [dir=back tooltip="include"]
    "8" -> "4" [dir=back tooltip="include"]
    "8" -> "18" [dir=back tooltip="include"]
    "8" -> "31" [dir=back tooltip="include"]
    "8" -> "13" [dir=back tooltip="include"]
    "8" -> "29" [dir=back tooltip="include"]
    "8" -> "28" [dir=back tooltip="include"]
    "8" -> "23" [dir=back tooltip="include"]
    "8" -> "5" [dir=back tooltip="include"]
    "8" -> "55" [dir=back tooltip="include"]
    "8" -> "42" [dir=back tooltip="include"]
    "8" -> "48" [dir=back tooltip="include"]
    "8" -> "33" [dir=back tooltip="include"]
    "8" -> "30" [dir=back tooltip="include"]
    "25" -> "26" [dir=back tooltip="include"]
    "25" -> "12" [dir=back tooltip="include"]
    "25" -> "13" [dir=back tooltip="include"]
    "25" -> "29" [dir=back tooltip="include"]
    "25" -> "28" [dir=back tooltip="include"]
    "25" -> "23" [dir=back tooltip="include"]
    "25" -> "5" [dir=back tooltip="include"]
    "25" -> "24" [dir=back tooltip="include"]
    "25" -> "30" [dir=back tooltip="include"]
    "40" -> "5" [dir=back tooltip="include"]
    "1" -> "2" [dir=back tooltip="include"]
    "1" -> "3" [dir=back tooltip="include"]
    "1" -> "7" [dir=back tooltip="include"]
    "37" -> "29" [dir=back tooltip="include"]
    "38" -> "28" [dir=back tooltip="include"]
    "22" -> "14" [dir=back tooltip="include"]
    "22" -> "2" [dir=back tooltip="include"]
    "22" -> "4" [dir=back tooltip="include"]
    "22" -> "23" [dir=back tooltip="include"]
    "22" -> "5" [dir=back tooltip="include"]
    "22" -> "24" [dir=back tooltip="include"]
    "22" -> "6" [dir=back tooltip="include"]
    "22" -> "7" [dir=back tooltip="include"]
    "35" -> "14" [dir=back tooltip="include"]
    "35" -> "2" [dir=back tooltip="include"]
    "35" -> "18" [dir=back tooltip="include"]
    "35" -> "13" [dir=back tooltip="include"]
    "35" -> "23" [dir=back tooltip="include"]
    "35" -> "7" [dir=back tooltip="include"]
    "35" -> "21" [dir=back tooltip="include"]
    "36" -> "18" [dir=back tooltip="include"]
    "36" -> "13" [dir=back tooltip="include"]
    "36" -> "29" [dir=back tooltip="include"]
    "36" -> "37" [dir=back tooltip="include"]
    "36" -> "28" [dir=back tooltip="include"]
    "36" -> "38" [dir=back tooltip="include"]
    "36" -> "23" [dir=back tooltip="include"]
    "36" -> "39" [dir=back tooltip="include"]
    "36" -> "5" [dir=back tooltip="include"]
    "36" -> "40" [dir=back tooltip="include"]
    "36" -> "24" [dir=back tooltip="include"]
    "19" -> "20" [dir=back tooltip="include"]
    "19" -> "4" [dir=back tooltip="include"]
    "19" -> "21" [dir=back tooltip="include"]
    "50" -> "51" [dir=back tooltip="include"]
    "50" -> "14" [dir=back tooltip="include"]
    "50" -> "15" [dir=back tooltip="include"]
    "50" -> "53" [dir=back tooltip="include"]
    "50" -> "2" [dir=back tooltip="include"]
    "50" -> "4" [dir=back tooltip="include"]
    "50" -> "18" [dir=back tooltip="include"]
    "50" -> "31" [dir=back tooltip="include"]
    "50" -> "13" [dir=back tooltip="include"]
    "50" -> "29" [dir=back tooltip="include"]
    "50" -> "28" [dir=back tooltip="include"]
    "50" -> "38" [dir=back tooltip="include"]
    "50" -> "23" [dir=back tooltip="include"]
    "50" -> "39" [dir=back tooltip="include"]
    "50" -> "5" [dir=back tooltip="include"]
    "50" -> "40" [dir=back tooltip="include"]
    "50" -> "41" [dir=back tooltip="include"]
    "50" -> "42" [dir=back tooltip="include"]
    "50" -> "24" [dir=back tooltip="include"]
    "50" -> "48" [dir=back tooltip="include"]
    "50" -> "43" [dir=back tooltip="include"]
    "50" -> "34" [dir=back tooltip="include"]
    "50" -> "35" [dir=back tooltip="include"]
    "39" -> "23" [dir=back tooltip="include"]
    "39" -> "5" [dir=back tooltip="include"]
    "49" -> "11" [dir=back tooltip="include"]
    "49" -> "18" [dir=back tooltip="include"]
    "49" -> "13" [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.

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.

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"]
    "14" [label="SpinLock" tooltip="SpinLock"]
    "1" [label="ResourceType" tooltip="ResourceType" fillcolor="#BFBFBF"]
    "8" [label="Module" tooltip="Module"]
    "7" [label="ListHead" tooltip="ListHead"]
    "2" [label="GlobalContext" tooltip="GlobalContext"]
    "10" [label="ModuleFilename" tooltip="ModuleFilename"]
    "5" [label="HNodeGroup" tooltip="HNodeGroup"]
    "13" [label="TimerList" tooltip="TimerList"]
    "11" [label="LiteralEntry" tooltip="LiteralEntry"]
    "12" [label="AtomsHashTable" tooltip="AtomsHashTable"]
    "3" [label="AtomTable" tooltip="AtomTable"]
    "9" [label="ExportedFunction" tooltip="ExportedFunction"]
    "6" [label="SyncList" tooltip="SyncList"]
    "4" [label="HNode" tooltip="HNode"]
    "1" -> "2" [dir=forward tooltip="usage"]
    "1" -> "7" [dir=forward tooltip="usage"]
    "8" -> "9" [dir=forward tooltip="usage"]
    "8" -> "10" [dir=forward tooltip="usage"]
    "8" -> "11" [dir=forward tooltip="usage"]
    "8" -> "7" [dir=forward tooltip="usage"]
    "7" -> "7" [dir=forward tooltip="usage"]
    "2" -> "3" [dir=forward tooltip="usage"]
    "2" -> "6" [dir=forward tooltip="usage"]
    "2" -> "8" [dir=forward tooltip="usage"]
    "2" -> "12" [dir=forward tooltip="usage"]
    "2" -> "13" [dir=forward tooltip="usage"]
    "2" -> "14" [dir=forward tooltip="usage"]
    "2" -> "7" [dir=forward tooltip="usage"]
    "5" -> "4" [dir=forward tooltip="usage"]
    "5" -> "5" [dir=forward tooltip="usage"]
    "13" -> "7" [dir=forward tooltip="usage"]
    "12" -> "4" [dir=forward tooltip="usage"]
    "3" -> "4" [dir=forward tooltip="usage"]
    "3" -> "5" [dir=forward tooltip="usage"]
    "6" -> "7" [dir=forward tooltip="usage"]
    "4" -> "4" [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"]
    "16" [label="SpinLock" tooltip="SpinLock"]
    "1" [label="SelectEvent" tooltip="SelectEvent" fillcolor="#BFBFBF"]
    "3" [label="ResourceType" tooltip="ResourceType"]
    "10" [label="Module" tooltip="Module"]
    "9" [label="ListHead" tooltip="ListHead"]
    "4" [label="GlobalContext" tooltip="GlobalContext"]
    "12" [label="ModuleFilename" tooltip="ModuleFilename"]
    "7" [label="HNodeGroup" tooltip="HNodeGroup"]
    "15" [label="TimerList" tooltip="TimerList"]
    "13" [label="LiteralEntry" tooltip="LiteralEntry"]
    "14" [label="AtomsHashTable" tooltip="AtomsHashTable"]
    "2" [label="RefcBinary" tooltip="RefcBinary"]
    "5" [label="AtomTable" tooltip="AtomTable"]
    "11" [label="ExportedFunction" tooltip="ExportedFunction"]
    "8" [label="SyncList" tooltip="SyncList"]
    "6" [label="HNode" tooltip="HNode"]
    "1" -> "2" [dir=forward tooltip="usage"]
    "1" -> "9" [dir=forward tooltip="usage"]
    "3" -> "4" [dir=forward tooltip="usage"]
    "3" -> "9" [dir=forward tooltip="usage"]
    "10" -> "11" [dir=forward tooltip="usage"]
    "10" -> "12" [dir=forward tooltip="usage"]
    "10" -> "13" [dir=forward tooltip="usage"]
    "10" -> "9" [dir=forward tooltip="usage"]
    "9" -> "9" [dir=forward tooltip="usage"]
    "4" -> "5" [dir=forward tooltip="usage"]
    "4" -> "8" [dir=forward tooltip="usage"]
    "4" -> "10" [dir=forward tooltip="usage"]
    "4" -> "14" [dir=forward tooltip="usage"]
    "4" -> "15" [dir=forward tooltip="usage"]
    "4" -> "16" [dir=forward tooltip="usage"]
    "4" -> "9" [dir=forward tooltip="usage"]
    "7" -> "6" [dir=forward tooltip="usage"]
    "7" -> "7" [dir=forward tooltip="usage"]
    "15" -> "9" [dir=forward tooltip="usage"]
    "14" -> "6" [dir=forward tooltip="usage"]
    "2" -> "3" [dir=forward tooltip="usage"]
    "2" -> "9" [dir=forward tooltip="usage"]
    "5" -> "6" [dir=forward tooltip="usage"]
    "5" -> "7" [dir=forward tooltip="usage"]
    "8" -> "9" [dir=forward tooltip="usage"]
    "6" -> "6" [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