From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23713 invoked by alias); 26 Jun 2004 01:27:16 -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 23679 invoked from network); 26 Jun 2004 01:27:13 -0000 Received: from unknown (HELO develer.com) (151.38.19.110) by sourceware.org with SMTP; 26 Jun 2004 01:27:13 -0000 Received: (qmail 30518 invoked from network); 26 Jun 2004 01:27:10 -0000 Received: from beetle.trilan (HELO ?10.3.2.254?) (?P9hoYO/XLzdMIM+I53uldspbHnpJfPy7?@10.3.2.254) by ns.trilan with SMTP; 26 Jun 2004 01:27:10 -0000 Message-ID: <40DCD0EE.9010208@develer.com> Date: Sat, 26 Jun 2004 01:27:00 -0000 From: Bernardo Innocenti Organization: Develer S.r.l. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040622 MIME-Version: 1.0 To: Ian Lance Taylor 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> In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2004-06/txt/msg00545.txt.bz2 Ian Lance Taylor wrote: > Bernardo Innocenti writes: > > >>2004-06-26 Bernardo Innocenti >> >> * include/libiberty.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Move >> here from libcpp/internal.h. >> (xcrealloc, xdelete, xdeletevec): New macros. >> >>libcpp: >> >>2004-06-26 Bernardo Innocenti >> >> * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Move these >> macros to include/libiberty.h. > > > The libiberty part is fine except for xcrealloc. That name clearly > shouldn't have a 'c' in it. Also, it doesn't seem to fit the general > copying of C++ names. In C++ there isn't realloc to correpond to new > and delete. Still, I suppose C needs realloc. But we can't use > xrealloc, because that is taken. So how about xresize? On second thought, the interface for xrenew() or xresize() wasn't even usable without a size argument. Maybe this would be better? #define xrenewvec(P, T, N) (T *) xrealloc ((P), sizeof(T) * (N)) -- // Bernardo Innocenti - Develer S.r.l., R&D dept. \X/ http://www.develer.com/