created doc for why2_clean_memory

This commit is contained in:
Václav Šmejkal 2025-01-25 21:20:49 +01:00
parent ba54f62f4d
commit d438578f6e
Signed by: ENGO150
GPG Key ID: 4A57E86482968843
2 changed files with 51 additions and 11 deletions

View File

@ -0,0 +1,39 @@
<!--
This is part of WHY2
Copyright (C) 2022 Václav Šmejkal
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
# why2_clean_memory
## Parameters
| Identifier | Data type |
| ------------ | --------- |
| `identifier` | `char *` |
## Attributes
| | |
| ------------------ | ---------------------------------------------- |
| **Return type** | `void` |
| **Header comment** | `identifier SPECIFIES WHICH NODES TO DEALLOCATE | THIS IS BASICALLY GARBAGE COLLECTOR | PASS why2_get_default_memory_identifier() FOR DEALLOCATING EVERYTHING` |
| **Added in commit** | [`abbd82077821c3b06720212ca89f5d9438500a48`](https://github.com/ENGO150/WHY2/commit/abbd82077821c3b06720212ca89f5d9438500a48) |
## Description
This is basically a garbage collector.
Function [deallocates](../why2_deallocate) all memory allocated with WHY2-memory, with ID `identifier`. You can pass `why2_get_default_memory_identifier()` as `identifier` to deallocate all memory.

View File

@ -87,17 +87,18 @@ You can find documentation for every *public* function of WHY2 below.
### Memory ### Memory
| Function | Description | | Function | Description |
| -------------------------------------------------- | ---------------------------------------------------------- | | ------------------------------------------------------ | ---------------------------------------------------------- |
| [`why2_malloc`](./core/memory/why2_malloc) | *This functions doesn't have any description.* | | [`why2_malloc`](./core/memory/why2_malloc) | *This functions doesn't have any description.* |
| [`why2_calloc`](./core/memory/why2_calloc) | *This functions doesn't have any description.* | | [`why2_calloc`](./core/memory/why2_calloc) | *This functions doesn't have any description.* |
| [`why2_realloc`](./core/memory/why2_realloc) | This doesn't preserve content of pointer! | | [`why2_realloc`](./core/memory/why2_realloc) | This doesn't preserve content of pointer! |
| [`why2_recalloc`](./core/memory/why2_recalloc) | Same as why2_realloc but fills the pointer with null-terms | | [`why2_recalloc`](./core/memory/why2_recalloc) | Same as why2_realloc but fills the pointer with null-terms |
| [`why2_strdup`](./core/memory/why2_strdup) | *This functions doesn't have any description.* | | [`why2_strdup`](./core/memory/why2_strdup) | *This functions doesn't have any description.* |
| [`why2_fopen`](./core/memory/why2_fopen) | *This functions doesn't have any description.* | | [`why2_fopen`](./core/memory/why2_fopen) | *This functions doesn't have any description.* |
| [`why2_fdopen`](./core/memory/why2_fdopen) | *This functions doesn't have any description.* | | [`why2_fdopen`](./core/memory/why2_fdopen) | *This functions doesn't have any description.* |
| [`why2_opendir`](./core/memory/why2_opendir) | *This functions doesn't have any description.* | | [`why2_opendir`](./core/memory/why2_opendir) | *This functions doesn't have any description.* |
| [`why2_deallocate`](./core/memory/why2_deallocate) | *This functions doesn't have any description.* | | [`why2_deallocate`](./core/memory/why2_deallocate) | *This functions doesn't have any description.* |
| [`why2_clean_memory`](./core/memory/why2_clean_memory) | identifier specifies which nodes to deallocate \| this is basically garbage collector \| pass why2_get_default_memory_identifier() for deallocating everything |
## Logger ## Logger