123456789101112131415161718192021222324252627282930313233343536373839 |
- /* $Id$ */
- /*
- * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- */
- /* clear - clear a block of memory, and try to do it fast.
- */
- #include "alloc.h"
- /* instead of Calloc: */
- void
- clear(ptr, n)
- register char *ptr;
- register unsigned int n;
- {
- register long *q = (long *) ptr;
- while (n >= 8*sizeof (long)) {
- /* high-speed clear loop */
- *q++ = 0;
- *q++ = 0;
- *q++ = 0;
- *q++ = 0;
- *q++ = 0;
- *q++ = 0;
- *q++ = 0;
- *q++ = 0;
- n -= 8*sizeof (long);
- }
- while (n >= sizeof (long)) {
- /* high-speed clear loop */
- *q++ = 0;
- n -= sizeof (long);
- }
- ptr = (char *) q;
- while (n--) *ptr++ = '\0';
- }
|