HDIR = $(EMHOME)/modules/h
INSTALL=$(EMHOME)/modules/install
COMPARE=$(EMHOME)/modules/compare
+INCLUDES = -I. -I$(HDIR)
-CFLAGS = -O -I. -I$(HDIR)
+CFLAGS = -O $(INCLUDES)
-SOURCES = alloc.h\
- Malloc.c\
+CSRC = Malloc.c\
botch.c\
clear.c\
st_alloc.c\
std_alloc.c \
No_Mem.c
+SOURCES = alloc.h\
+ $(CSRC)
OBJECTS = botch.o clear.o st_alloc.o Malloc.o std_alloc.o No_Mem.o
clean:
rm -f *.[oa]
+lintlib:
+ lint $(INCLUDES) -Calloc $(CSRC)
+ mv llib-lalloc.ln $(EMHOME)/modules/lib
st_alloc.o: alloc.h
std_alloc.o: alloc.h
Malloc.o: alloc.h
to check if freed memory is used inappopriately.
*/
-#include <assert.h>
#include "in_all.h"
EXPORT
botch(ptr, n)
- char *ptr;
- int n;
+ register char *ptr;
+ register int n;
{
- assert((long)ptr % sizeof (long) == 0);
while (n >= sizeof (long)) {
/* high-speed botch loop */
*(long *)ptr = 025252525252L;
/* clear - clear a block of memory, and try to do it fast.
*/
-#include <assert.h>
#include "in_all.h"
/* instead of Calloc: */
{
register long *q = (long *) ptr;
- assert((long)q % sizeof (long) == 0);
while (n >= sizeof (long)) {
/* high-speed clear loop */
*q++ = 0;
register unsigned int size;
{
register char *p;
+ register long *q;
char *retval;
if (*phead == 0) {
*phead = ((struct xxx *)p)->next;
retval = p;
if (size >= sizeof(long)) {
- register long *q = (long *) p;
+ q = (long *) p;
do {
*q++ = 0;
size -= sizeof(long);
EMHOME=../../..
MODULES=$(EMHOME)/modules
HDIR = $(MODULES)/h
-CFLAGS = -I$(HDIR) -O
+INCLUDES = -I$(HDIR)
+CFLAGS = $(INCLUDES) -O
INSTALL = $(MODULES)/install
COMPARE = $(MODULES)/compare
clean:
rm -f *.[oa]
+
+lintlib:
+ lint $(INCLUDES) -Cassert BadAssert.c
+ mv llib-lassert.ln $(MODULES)/lib