Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!brl-smoke!smoke!cottrell@NBS-VMS.ARPA From: cottrell@NBS-VMS.ARPA (COTTRELL, JAMES) Newsgroups: net.lang.c Subject: Fast CALLOC Message-ID: <1135@brl-smoke.ARPA> Date: Wed, 19-Feb-86 16:45:38 EST Article-I.D.: brl-smok.1135 Posted: Wed Feb 19 16:45:38 1986 Date-Received: Sun, 23-Feb-86 05:54:33 EST Sender: news@brl-smoke.ARPA Lines: 13 > Here's a version of calloc that breaks every rule of "structured" > programming ever invented -- and runs about twice as fast as a > vanilla version: I was amused the first time I saw this trick. However, your vehicle is a poor choice to implement it in. Why don't you just round up the number of int's (long's, whatever) to the next multiple of eight, allocate that much space, & then you wouldn't need the switch. Nobody cares about a few extra bytes when they do [mc]alloc's. jim cottrell@nbs */ ------