42sh 1.0.0
Create a shell in C
Loading...
Searching...
No Matches
my_malloc.c File Reference

The file containing the my_malloc function. More...

#include "mymemory.h"

Functions

void * my_malloc (size_t size, int type)
 Allocates memory for an array of bytes (size)
 

Detailed Description

The file containing the my_malloc function.

Author
Nicolas TORO

Function Documentation

◆ my_malloc()

void * my_malloc ( size_t size,
int type )

Allocates memory for an array of bytes (size)

Note
type = 0: Free allocated memory with my_malloc
type = 1: Allocate memory
Parameters
sizeThe size of the memory to allocate
typeThe type of the usage
Returns
void * A pointer to the allocated memory
Author
Nicolas TORO