Memory functions.
More...
|
void | ft_bzero (void *s, size_t n) |
| Set at 0, the n first bytes at the pointer adress.
|
|
void * | ft_memcpy (void *destination, const void *source, size_t size) |
| Set a memory zone with a value, count times.
|
|
void * | ft_memset (void *pointer, int value, size_t count) |
| Set a memory zone with a value, count times.
|
|
void * | ft_memmove (void *destination, const void *source, size_t size) |
| Moves the memory blocks avoiding overlapping, until size blocks.
|
|
const void * | ft_memchr (const void *memory_block, int searched_char, size_t size) |
| Research the first occurence of a value typed int, but interpreted as a char in a memory block.
|
|
int | ft_memcmp (const void *src, const void *set, size_t size) |
| Compares the first size bytes of the memory areas src and set.
|
|
void * | ft_calloc (size_t element_count, size_t element_size) |
| Allocates a new memory zone, and set all bits to zero.
|
|
Memory functions.
◆ ft_bzero()
void ft_bzero |
( |
void * | s, |
|
|
size_t | n ) |
Set at 0, the n first bytes at the pointer adress.
- Parameters
-
s | pointer to the memory to set |
n | number of bytes to set at 0 |
◆ ft_calloc()
void * ft_calloc |
( |
size_t | element_count, |
|
|
size_t | element_size ) |
Allocates a new memory zone, and set all bits to zero.
- Parameters
-
element_count | number of elements |
element_size | size of each element |
- Returns
- void* pointer to the new memory zone
◆ ft_memchr()
const void * ft_memchr |
( |
const void * | memory_block, |
|
|
int | searched_char, |
|
|
size_t | size ) |
Research the first occurence of a value typed int, but interpreted as a char in a memory block.
- Parameters
-
memory_block | memory block to search in |
searched_char | value to search |
size | size of the memory block |
- Returns
- void* pointer to the first occurence of the value or NULL if not found
◆ ft_memcmp()
int ft_memcmp |
( |
const void * | src, |
|
|
const void * | set, |
|
|
size_t | size ) |
Compares the first size bytes of the memory areas src and set.
- Parameters
-
src | source memory block |
set | set memory block |
size | size of the memory block |
- Returns
- int difference between the first different byte
◆ ft_memcpy()
void * ft_memcpy |
( |
void * | destination, |
|
|
const void * | source, |
|
|
size_t | size ) |
Set a memory zone with a value, count times.
- Parameters
-
destination | memory zone to paste |
source | memory zone to copy |
size | number of times to set the value |
- Returns
- void* pointer to the memory zone
◆ ft_memmove()
void * ft_memmove |
( |
void * | destination, |
|
|
const void * | source, |
|
|
size_t | size ) |
Moves the memory blocks avoiding overlapping, until size blocks.
- Parameters
-
destination | destination memory block |
source | source memory block |
size | size of the memory block |
- Returns
- void* pointer to the destination memory block
◆ ft_memset()
void * ft_memset |
( |
void * | pointer, |
|
|
int | value, |
|
|
size_t | count ) |
Set a memory zone with a value, count times.
- Parameters
-
pointer | memory zone to set |
value | value to set |
count | number of times to set the value |
- Returns
- void* pointer to the memory zone