RF_Developer
Joined: 07 Feb 2011 Posts: 839
|
Re: data structure is possible??????? |
Posted: Wed Jan 04, 2012 3:50 am |
|
|
gokulrred wrote: | hi
i want to form a queue (data structure concept) in ccs.
is it possible.
if possible can u give any guidelines? |
Its possible. The "obvious" way is to use the standard C dynamic memory allocation routines: malloc(), free() etc.. CCS is "normal" C as far as this is concerned. HOWEVER PICs have very limited RAM and so your heap size will be tiny in comparison to what you may be used to. Also, as is always the case in C, all sorts of things can go wrong when you use pointers, and these faults can be very difficult to find.
I never use dynamic allocation in any of my embedded projects, Not even with ARMs where RAM is more plentiful than on the PICS. There's simply too much risk and too little benefit. Instead I use fixed allocated memory: fixed length, carefully managed queues and buffers.
RF Developer
PS: one question mark is sufficient |
|