CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

data structure is possible???????

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
gokulrred



Joined: 22 Nov 2011
Posts: 32
Location: puducherry

View user's profile Send private message Send e-mail

data structure is possible???????
PostPosted: Wed Jan 04, 2012 12:08 am     Reply with quote

hi
i want to form a queue (data structure concept) in ccs.

is it possible.

if possible can u give any guidelines?
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

Re: data structure is possible???????
PostPosted: Wed Jan 04, 2012 3:50 am     Reply with quote

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 Wink
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group