[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 Mon, Nov 10, 2003 at 11:16:46PM -0800, Per I. Mathisen wrote:
>
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=6822 >
>
> On Mon, 10 Nov 2003, Raimar Falke 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'tlikely to compile C99 anyway).It's also
> > > safer and more legible.
> >
> > I don't see that the benefits (safer) outweigh the costs (change must
> > be done, compiler or other tools doesn't understand it).
>
> We already use such arrays elsewhere.
We do? A quick grep didn't found cases.
> This might have considerable speed impact on win32 platform, since I hear
> malloc is extremely slow there, and this patch removes _a lot_ of mallocs.
Can we replace this hearsay with some facts? It turned out false for
Linux.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"brand memory are for windows users that think their stability
problems come from the memory"
-- bomek in #freeciv
- [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 <=
- [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, 2003/11/11
- [Freeciv-Dev] Re: (PR#6822) some variable-sized arrays, Raimar Falke, 2003/11/14
|
|