public
/
ack.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f61ddc4
)
Don't use calloc and our own malloc combined
author
ceriel
<none@none>
Mon, 2 Dec 1991 14:44:20 +0000
(14:44 +0000)
committer
ceriel
<none@none>
Mon, 2 Dec 1991 14:44:20 +0000
(14:44 +0000)
lang/m2/m2mm/main.c
patch
|
blob
|
history
lang/m2/m2mm/program.g
patch
|
blob
|
history
diff --git
a/lang/m2/m2mm/main.c
b/lang/m2/m2mm/main.c
index
95a8433
..
74042b1
100644
(file)
--- a/
lang/m2/m2mm/main.c
+++ b/
lang/m2/m2mm/main.c
@@
-122,13
+122,19
@@
struct file_list *
new_file_list()
{
static struct file_list *p;
+ register struct file_list *f;
static int cnt;
- extern char *calloc();
- if (cnt--) return p++;
- p = (struct file_list *)calloc(50, sizeof(struct file_list));
- cnt = 49;
- return p++;
+ if (cnt-- < 0) {
+ p = (struct file_list *)Malloc(50*sizeof(struct file_list));
+ cnt = 49;
+ }
+ f = p++;
+ f->a_filename = 0;
+ f->a_dir = 0;
+ f->a_next = 0;
+ f->a_idf = 0;
+ f->a_notfound = 0;
}
Add(parglist, f, d, copy)
diff --git
a/lang/m2/m2mm/program.g
b/lang/m2/m2mm/program.g
index
8cc218f
..
80d0293
100644
(file)
--- a/
lang/m2/m2mm/program.g
+++ b/
lang/m2/m2mm/program.g
@@
-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++;
}
}