[Freeciv-Dev] Re: (PR#6822) some variable-sized arrays
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=6822 >
On Tue, Nov 11, 2003 at 08:10:47AM -0800, Gregory Berkolaiko wrote:
>
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=6822 >
>
> On Mon, 10 Nov 2003, Jason Short wrote:
>
> > The attached patch replaces some malloc'd arrays with variable-sized
> > stack arrays. One memory leak is fixed in the process.
> >
> > This should be faster, but my tests didn't show a measurable difference
> > (on systems with inefficient malloc calls this may make an impact - but
> > then those systems aren't likely to compile C99 anyway). It's also
> > safer and more legible.
>
> Why should it make a difference?
> Aren't variable-sized arrays mplemented via malloc?
That would be stupid. No they are a portable version of alloca.
> Or because of the clearly defined scope the memory management is
> easier?
Yes. This is an advantage but I don't see the gain for freeciv.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
1 + 1 = 3, for large values of 1
- [Freeciv-Dev] Re: (PR#6822) some variable-sized arrays, Raimar Falke, 2003/11/11
- [Freeciv-Dev] Re: (PR#6822) some variable-sized arrays, Jason Short, 2003/11/11
- [Freeciv-Dev] Re: (PR#6822) some variable-sized arrays, Per I. Mathisen, 2003/11/11
- [Freeciv-Dev] Re: (PR#6822) some variable-sized arrays, Raimar Falke, 2003/11/11
- [Freeciv-Dev] Re: (PR#6822) some variable-sized arrays, Raimar Falke, 2003/11/11
- [Freeciv-Dev] Re: (PR#6822) some variable-sized arrays, Gregory Berkolaiko, 2003/11/11
- [Freeciv-Dev] Re: (PR#6822) some variable-sized arrays,
Raimar Falke <=
- [Freeciv-Dev] Re: (PR#6822) some variable-sized arrays, Raimar Falke, 2003/11/14
|
|