Skip to content

Commit ec59271

Browse files
committed
Use mrbc_raw_calloc()
ref: mrubyc/mrubyc#219
1 parent 98104c5 commit ec59271

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/custom_allocator.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,7 @@ picorb_free(void* ptr)
1818
void*
1919
picorb_calloc(unsigned int nmemb, unsigned int size)
2020
{
21-
unsigned int total_size = nmemb * size;
22-
void* ptr = mrbc_raw_alloc(total_size);
23-
if (ptr != NULL) {
24-
memset(ptr, 0, total_size);
25-
}
26-
return ptr;
21+
return mrbc_raw_calloc(nmemb, size);
2722
}
2823

2924
void*

0 commit comments

Comments
 (0)