From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27127 invoked by alias); 26 Jun 2004 02:19:35 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 27106 invoked from network); 26 Jun 2004 02:19:34 -0000 Received: from unknown (209.128.65.135) by sourceware.org with QMTP; 26 Jun 2004 02:19:34 -0000 Received: (qmail 30633 invoked by uid 10); 26 Jun 2004 02:19:33 -0000 Received: (qmail 15593 invoked by uid 500); 26 Jun 2004 02:19:24 -0000 Mail-Followup-To: gcc-patches@gcc.gnu.org, gdb-patches@sources.redhat.com, binutils@sources.redhat.com, dj@redhat.com, bernie@develer.com From: Ian Lance Taylor To: Bernardo Innocenti Cc: GCC Patches , gdb-patches@sources.redhat.com, binutils@sources.redhat.com, DJ Delorie Subject: Re: [top-level] C++-friendly allocators for libiberty References: <40DCC86A.4010306@develer.com> <40DCD0EE.9010208@develer.com> Date: Sat, 26 Jun 2004 02:19:00 -0000 In-Reply-To: <40DCD0EE.9010208@develer.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-06/txt/msg00546.txt.bz2 Bernardo Innocenti writes: > On second thought, the interface for xrenew() or xresize() wasn't > even usable without a size argument. Oh yeah. > Maybe this would be better? > > #define xrenewvec(P, T, N) (T *) xrealloc ((P), sizeof(T) * (N)) No, people use realloc with variable size arrays at the end of structs. xrenewvec (or xresizevec) is a good idea, but you still need xrenew (or xresize). Also I noticed that you should have a space between "sizeof" and "(" in each use of "sizeof". I prefer xresize, since that was my idea. Any other ideas? Ian