From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26583 invoked from network); 24 Jun 1999 16:40:36 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 24 Jun 1999 16:40:36 -0000 Received: (qmail 29111 invoked by alias); 24 Jun 1999 16:40:20 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6834 Received: (qmail 29104 invoked from network); 24 Jun 1999 16:40:19 -0000 Message-Id: <9906241611.AA12953@ibmth.df.unipi.it> To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: PATCH: minor stuff Date: Thu, 24 Jun 1999 18:11:41 +0200 From: Peter Stephenson I noticed that dyncat() was advertised as always using heap memory, whereas actually it uses ncalloc() which chooses the current sort of allocation. Since all the uses seem to be in places where the memory doesn't get explicitly freed, maybe we should change the code to match the comment (which I probably put there). While I was doing this I noticed that the hashtable element tablename was never freed. It's only used with --zsh-hash-debug. --- Src/glob.c.dc Mon Jun 14 09:22:10 1999 +++ Src/glob.c Thu Jun 24 18:04:31 1999 @@ -1993,7 +1993,7 @@ char *ptr; int l1 = strlen(s1); - ptr = (char *)ncalloc(l1 + strlen(s2) + 1); + ptr = (char *)zhalloc(l1 + strlen(s2) + 1); strcpy(ptr, s1); strcpy(ptr + l1, s2); return ptr; --- Src/hashtable.c.dc Fri Jun 18 13:49:29 1999 +++ Src/hashtable.c Thu Jun 24 17:57:56 1999 @@ -133,6 +133,7 @@ ht->last->next = ht->next; else firstht = ht->next; + zsfree(ht->tablename); #endif /* ZSH_HASH_DEBUG */ zfree(ht->nodes, ht->hsize * sizeof(HashNode)); zfree(ht, sizeof(*ht)); -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy