Don't use calloc and our own malloc combined

This commit is contained in:
ceriel
1991-12-02 14:44:20 +00:00
parent 79bc624aae
commit 559beab0b3
2 changed files with 18 additions and 9 deletions

View File

@@ -30,17 +30,20 @@
#include "idf.h"
#include "f_info.h"
#include "LLlex.h"
#include <alloc.h>
struct lnk *
new_lnk()
{
static struct lnk *p;
static int cnt;
extern char *calloc();
if (cnt--) return p++;
p = (struct lnk *)calloc(50, sizeof(struct lnk));
cnt = 49;
if (cnt-- <= 0) {
p = (struct lnk *)Malloc(50*sizeof(struct lnk));
cnt = 49;
}
p->lnk_next = 0;
p->lnk_imp = 0;
return p++;
}
}