G
Guest
Hi, I use C# on Compact Framework for PPC program development. Well, I need
to use many ArrayList() of data and I don't know which is the best memory
management that I will have to use. Is more convenient to use a Class() or a
Struct() to store my data? For example (with some sintax errorrs):
class TPoint
{
int x;
int y;
}
or
struct TPoint
{
int x;
int y;
}
ArrayList MyPoints=new ArrayList();
PPoint=new TPoint();
for (iLoop=1; iLoop<=1000; iLoop++)
{
TPoint PPoint=(TPoint) MyPoints[MyPoints.Add(new TPoint())];
PPoint.x=iLoop;
PPoint.y=iLoop;
}
I read that Class() are stored in the Heap, while Struct() are stored in the
Stack memory. Well, which is the best way (for memory space, memory
performance, etc...) to store my data in PPC memory where I have a little
memory to manage?
to use many ArrayList() of data and I don't know which is the best memory
management that I will have to use. Is more convenient to use a Class() or a
Struct() to store my data? For example (with some sintax errorrs):
class TPoint
{
int x;
int y;
}
or
struct TPoint
{
int x;
int y;
}
ArrayList MyPoints=new ArrayList();
PPoint=new TPoint();
for (iLoop=1; iLoop<=1000; iLoop++)
{
TPoint PPoint=(TPoint) MyPoints[MyPoints.Add(new TPoint())];
PPoint.x=iLoop;
PPoint.y=iLoop;
}
I read that Class() are stored in the Heap, while Struct() are stored in the
Stack memory. Well, which is the best way (for memory space, memory
performance, etc...) to store my data in PPC memory where I have a little
memory to manage?