diff --git a/.zk/notebook.db b/.zk/notebook.db index c07d569..55af543 100644 Binary files a/.zk/notebook.db and b/.zk/notebook.db differ diff --git a/zk/Bitwise_operators.md b/zk/Bitwise_operators.md new file mode 100644 index 0000000..df96265 --- /dev/null +++ b/zk/Bitwise_operators.md @@ -0,0 +1,12 @@ +--- +id: t127 +title: Bitwise_operators +tags: [] +created: Saturday, April 20, 2024 +--- +# Bitwise_operators + + +## Related notes + + diff --git a/zk/Heap_memory.md b/zk/Heap_memory.md index aa2d010..470b4f7 100644 --- a/zk/Heap_memory.md +++ b/zk/Heap_memory.md @@ -20,6 +20,10 @@ _garbage collection_. In a language like C, this is the explicit concern of the programmer and is not abstracted away. Failure to properly manage garbage collection is what causes [[Memory_leaks]]. +Heap memory is used in combination with the stack since a given heap memory +allocation address is stored as a stack variable during runtime. It points to +the heap memory address whilst not being that memory itself. + Here is an example of managing heap memory allocation in C: ```c @@ -30,7 +34,8 @@ data = malloc(512) The first line assigns a special _pointer_ variable (indicated by `void *` rather than `int` or `str`) . This is a variable only holds a memory address. The `malloc` method requests 512 bytes that it wants to assign to the `data` -variable. it will return the address of the first byte in the newly allocated -memory. +variable. It will return the address of the first byte in the newly allocated +memory. `data` will then refer to the address on the stack that holds the +address allocation on the heap. ## Related notes