Changeset 44e8541 in mainline for uspace/lib/c/generic/malloc.c
- Timestamp:
- 2023-10-27T17:38:32Z (7 months ago)
- Branches:
- master, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fdfb24e
- Parents:
- b169619
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2023-10-27 15:17:18)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2023-10-27 17:38:32)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/malloc.c
rb169619 r44e8541 34 34 */ 35 35 36 #include < malloc.h>36 #include <stdlib.h> 37 37 #include <stdalign.h> 38 38 #include <stdbool.h> … … 47 47 #include <stdlib.h> 48 48 #include <adt/gcdlcm.h> 49 #include <malloc.h> 49 50 50 51 #include "private/malloc.h" … … 773 774 } 774 775 775 /** Allocate memory by number of elements776 *777 * @param nmemb Number of members to allocate.778 * @param size Size of one member in bytes.779 *780 * @return Allocated memory or NULL.781 *782 */783 void *calloc(const size_t nmemb, const size_t size)784 {785 // FIXME: Check for overflow786 787 void *block = malloc(nmemb * size);788 if (block == NULL)789 return NULL;790 791 memset(block, 0, nmemb * size);792 return block;793 }794 795 776 /** Allocate memory 796 777 *
Note:
See TracChangeset
for help on using the changeset viewer.