Mail Archives: djgpp/1998/09/23/21:13:21
Johan Henriksson wrote:
>
> Johan Henriksson #12035895
> Pri: johan DOT henriksson AT borlange DOT mail DOT telia DOT com
> Sec: jhe75 AT hotmail DOT com
> HTTP://come.to/jhewok
>
> I started my work on JHeCL, another com. library.
I assume you know of the existing libraries and are intentionally
reinventing the wheel? Okay.
> I want to optimize the
> FIFO so here's the question: Is it faster to access a static array than
> accessing a dynamic one.
In general, the same. Memory is memory. There could be issues with the
cache but they are very unpredictable and it's very hard to say which
would be preferable. IMHO, don't worry about it.
>And how do I create a 1Dim Dyn. array under DJGPP?
Static version:
int x[300];
Dynamic:
int *x;
x = malloc(300 * sizeof(int)); /* replace 300 with appropriate value */
Consider a C textbook; memory allocation in C is very important to
understand well.
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -