[A89] Re: Multi-dimensional Arrays in C...


[Prev][Next][Index][Thread]

[A89] Re: Multi-dimensional Arrays in C...




Hi!

> In TI-GCC this is a very bad way to do this because the
> number of handles available for dynamic memory is extremely
> limited.

The number of handles is not so extremely limited, but it is
limited anyway. Nobody is sure exactly about the total number
of handles available on the TI, but it seems that it is 2000
on all present AMS versions...

> In general it's not so great because the memory is not
> contiguously allocated.

This is usually not a problem. But, it is possible to make
function MultiDimensionalAlloc() which uses contiguous block,
and only one memory handle. Unfortunately, it is overcomplicated,
and I don't have a time to recreate it again (I once wrote it
before 12 years, so I know that it is possible).

> It can also be slow, but again the application will define
> whether that is a major concern or not.

Usually, multiple-pointer method is not slow. It is maybe even
faster, because this method internally uses extra indirection
instead of multiplication (and multiplying is usually slower).
But, multiple-pointer method uses more memory (to store extra
pointers to each row of a matrix).

Cheers,

Zeljko