This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [top-level] C++-friendly allocators for libiberty


Bernardo Innocenti <bernie@develer.com> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]