1.1 --- a/templates/ops.c Fri Jan 06 23:34:37 2017 +0100
1.2 +++ b/templates/ops.c Sat Jan 07 00:21:04 2017 +0100
1.3 @@ -16,7 +16,7 @@
1.4 this program. If not, see <http://www.gnu.org/licenses/>.
1.5 */
1.6
1.7 -#include <stdlib.h>
1.8 +#include "gc.h" /* GC_MALLOC, GC_REALLOC */
1.9 #include "ops.h"
1.10 #include "progops.h" /* for raising errors */
1.11 #include "progconsts.h"
1.12 @@ -303,7 +303,7 @@
1.13
1.14 void *__ALLOCATE(size_t nmemb, size_t size)
1.15 {
1.16 - void *ptr = calloc(nmemb, size);
1.17 + void *ptr = GC_MALLOC(nmemb * size); /* sets memory to zero */
1.18 if (ptr == NULL)
1.19 __raise_memory_error();
1.20 return ptr;
1.21 @@ -311,7 +311,7 @@
1.22
1.23 void *__REALLOCATE(void *ptr, size_t size)
1.24 {
1.25 - void *nptr = realloc(ptr, size);
1.26 + void *nptr = GC_REALLOC(ptr, size);
1.27 if (nptr == NULL)
1.28 __raise_memory_error();
1.29 return nptr;