| 15 | } |
| 16 | |
| 17 | void* calloc(size_t nmemb, size_t size) { |
| 18 | size_t total_size = nmemb * size; |
| 19 | void* ptr = malloc(total_size); |
| 20 | if (ptr != nullptr) { |
| 21 | memset(ptr, 0, total_size); |
| 22 | } |
| 23 | return ptr; |
| 24 | } |
| 25 | |
| 26 | void* realloc(void* ptr, size_t new_size) { |
| 27 | return ::realloc(ptr, new_size); |