Post a new topicPost a reply Page 1 of 1   [ 3 posts ]
Author Message
 Post subject: MEMORY LEAKS !! Are you having a problem ...
PostPosted: Wed Mar 07, 2012 4:37 pm 

Joined: Mon Oct 03, 2011 5:17 pm
Posts: 85
Just thought I would mention this as I was having a memory leak problem
and I have no prior AVR experience being a PIC programmer.

Having just read the programming style guide on the Libelium site it
says that sprintf must only be called once per function ...

If you call it more than once you will get a MEMORY LEAK !!!!!

Just sent for those who dont enjoy 12 hour days.

Rob


Top
 Profile  
 
 Post subject: Re: MEMORY LEAKS !! Are you having a problem ...
PostPosted: Thu Mar 08, 2012 9:55 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7818
robinaspey,

As you say, and also as it is said in programming style guide, sprintf function must be used with caution. Otherwise can cause problems (but not always).

Best way is use "callocs" to allocate memory and do "free" after the usage.

If you are having some trouble with this, please follow advises given in the programming style guide. It is a bit messy, but it should works.

Best regards.


Top
 Profile  
 
 Post subject: Re: MEMORY LEAKS !! Are you having a problem ...
PostPosted: Thu Mar 08, 2012 11:53 am 

Joined: Mon Oct 03, 2011 5:17 pm
Posts: 85
Ok thanks, I agree its a bit message but such things are to be expected with
embedded systems.

I am happy, I can have my holiday now!

Rob


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 3 posts ]


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

Search for:
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use