summaryrefslogtreecommitdiff
path: root/src/stdlib/calloc.c
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2024-05-28 14:56:06 -0400
committerJakob Kaivo <jkk@ung.org>2024-05-28 14:56:06 -0400
commitb4cd7036bea6c6440fbbcdaebe53c864c87a5646 (patch)
tree260670ad9a9637c8c36d84b9cf77ec412017b038 /src/stdlib/calloc.c
parenta69b11fd8974a898a26081950bd4add7c82ea45d (diff)
integrate jkmalloc/prep for readonly
Diffstat (limited to 'src/stdlib/calloc.c')
-rw-r--r--src/stdlib/calloc.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/stdlib/calloc.c b/src/stdlib/calloc.c
index e5b5f38b..b5203a57 100644
--- a/src/stdlib/calloc.c
+++ b/src/stdlib/calloc.c
@@ -1,30 +1,15 @@
#include <stdlib.h>
#include <string.h>
#include "_stdlib.h"
+#include "_jkmalloc.h"
/** allocate and initialize memory **/
void * calloc(size_t nmemb, size_t size)
{
- void *p = NULL;
- size_t total = nmemb * size;
-
SIGNAL_SAFE(0);
- if (total < nmemb || total < size) {
- return NULL;
- }
-
- if (nmemb == 0 || size == 0) {
- return NULL;
- }
-
- p = malloc(total);
- if (p != NULL) {
- memset(p, 0, size * nmemb);
- }
-
- return p;
+ return __jkmalloc(NULL, NULL, 0, NULL, 1, nmemb, size);
}
/***