diff --git a/Docs/MemoryManagement.md b/Docs/MemoryManagement.md index 9477a2a..972a632 100644 --- a/Docs/MemoryManagement.md +++ b/Docs/MemoryManagement.md @@ -25,10 +25,17 @@ Sets specified block of memory to specified value. HallocyError hallocy_set_memory(void *destination, int value, const size_t size); ``` +**Args**: + - `destination`: The memory to set the value of. - `value`: The value to set the memory in destination to. - `size`: The size of the memory in bytes to set the value of. +**Returns**: + +- **HALLOCY_ERROR_NONE**: Successfully set memory. +- **HALLOCY_ERROR_INVALID_POINTER**: Invalid pointer was given. + ### Copy memory Copies memory from one pointer to another pointer. @@ -37,10 +44,17 @@ Copies memory from one pointer to another pointer. HallocyError hallocy_copy_memory(void *destination, void *source, const size_t size); ``` +**Args**: + - `destination`: The memory to copy the values to. - `source`: The memory to copy the values from. - `size`: The size of the memory in bytes to copy the value to. +**Returns**: + +- **HALLOCY_ERROR_NONE**: Successfully copied memory. +- **HALLOCY_ERROR_INVALID_POINTER**: Invalid pointers where given. + ### Move memory Copies memory from one pointer to another pointer. Unlike the `hallocy_copy_memory` function this function will handle overlapping memory right. @@ -49,20 +63,31 @@ Copies memory from one pointer to another pointer. Unlike the `hallocy_copy_memo HallocyError hallocy_move_memory(void *destination, void *source, const size_t size); ``` +**Args**: + - `destination`: The memory to copy the values to. - `source`: The memory to copy the values from. - `size`: The size of the memory in bytes to copy the value to. +**Returns**: + +- **HALLOCY_ERROR_NONE**: Successfully moved memory. +- **HALLOCY_ERROR_INVALID_POINTER**: Invalid pointers where given. + ### Compare memory ```c bool hallocy_compare_memory(void *left_side, void *right_side, const size_t size); ``` +**Args**: + - `left_side`: The memory to compare with the right side. - `right_side`: The memory to compare with the left side. - `size`: The size of the memory in bytes to compare the value to. +**Returns**: True if both pointers contain same content, else returns false. + ## Example usage ```c