created doc for why2_recalloc

This commit is contained in:
Václav Šmejkal 2025-01-25 21:00:24 +01:00
parent 10d5402775
commit bf0355761b
Signed by: ENGO150
GPG Key ID: 4A57E86482968843
2 changed files with 45 additions and 5 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_recalloc
## Parameters
| Identifier | Data type |
| ------------ | --------------- |
| `pointer` | `void *` |
| `size` | `unsigned long` |
| `block_size` | `unsigned long` |
## Attributes
| | |
| ------------------ | ------------------------------------------------------------ |
| **Return type** | `void *` |
| **Header comment** | `SAME AS why2_realloc BUT FILLS THE pointer WITH NULL-TERMS` |
| **Added in commit** | [`c5394e63e50e7c2e018a4323d33821c4f4e14884`](https://github.com/ENGO150/WHY2/commit/c5394e63e50e7c2e018a4323d33821c4f4e14884) |
## Description
Function deallocates `pointer` (only applicable if `pointer` was allocated using WHY2-memory), passes `size` and `block_size` into [`calloc`](https://linux.die.net/man/3/calloc) function and returns the output value. The value is also pushed to [`linked-list`](../../../../types/core/llist/why2_list_t) for garbage collector.

View File

@ -87,11 +87,12 @@ 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 |
## Logger ## Logger