一呼百應, "one call, a hundred responses"
Loading...
Searching...
No Matches
Handles
Collaboration diagram for Handles:

Macros

#define ein_acquire_handle(__x)
 indicates this method returns an acquired resource
 
#define ein_release_handle(__x)
 Indicates this argument is an acquired resource that is being released with a tag.
 
#define ein_use_handle(__x)
 indicates this argument is a use of a resource, but does not release it.
 

Detailed Description

Handles are a way to identify resources like files, sockets, and processes.

They are more opaque than pointers and widely used in system programming. They have similar risks such as never releasing a resource associated with a handle, attempting to use a handle that was already released, or trying to release a handle twice.

Using the annotations below it is possible to make the ownership of the handles clear: whose responsibility is to release them. They can also aid static analysis tools to find bugs.

*‍/

Macro Definition Documentation

◆ ein_acquire_handle

#define ein_acquire_handle ( __x)

indicates this method returns an acquired resource

Names its type with a tag.

If applied to a method it refers to the function result If applied to an argument it indicates that argument is an out-parameter providing the value

Definition at line 48 of file handles.hpp.

◆ ein_release_handle

#define ein_release_handle ( __x)

Indicates this argument is an acquired resource that is being released with a tag.

Definition at line 58 of file handles.hpp.

◆ ein_use_handle

#define ein_use_handle ( __x)

indicates this argument is a use of a resource, but does not release it.

Definition at line 68 of file handles.hpp.