-
Notifications
You must be signed in to change notification settings - Fork 16
/
pointer_references.theory.txt
29 lines (20 loc) · 2.34 KB
/
pointer_references.theory.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
POINTER_REFERENCES
REFERENCE ==> #Value that points to any other value, not necessarily through memory address
#E.g. used when memory address itself is not exposed by reference
#Interpreting a reference is "dereferencing"
#Contrasts to using a copy of the data.
#Value can be:
# - a memory address ("pointer")
# - an offset
# - a name ("key" or "identifier"), e.g. a variable
# - an opaque name ("handle")
# - e.g. file descriptors, PIDs, sockets, database connections
STRONG VS WEAK ==> #See garbage collection doc
ERRORS ==> #Segmentation fault: dereferencing to an address outside what the current process can access
#Dangling|wild pointer: pointer assumed type is not what the pointed value actually is
NULL POINTER ==> #See emptiness doc
MULTIPLE INDIRECTION ==> #Pointer targetting another pointer
SMART POINTER ==> #Object that behaves like a reference.
#Used to add behavior such as memory management or bound checking