View Single Post
  #14   Spotlight this post!  
Unread 28-09-2011, 23:58
mesamb1's Avatar
mesamb1 mesamb1 is offline
Registered User
AKA: Sam Bacon
FRC #1466 (Webb Robotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2004
Location: Knoxville
Posts: 93
mesamb1 is just really nicemesamb1 is just really nicemesamb1 is just really nicemesamb1 is just really nice
Re: Delay in controls (HELP!)

Quote:
Originally Posted by apalrd View Post
I've always understood embedded systems (such as FIRST robots) which run in real time iteratively have little need for dynamic memory allocation (as they always use the same variables, and pass data in and out of functions and variable storage).
Quote:
Originally Posted by apalrd View Post
In FRC, I use LabVIEW which does everything for me.
The short answer is not quite. You cant ever forget memory. Any time you call a function and it has any variable you have allocated more memory you run the risk of trouble. Even with 8GBs of ram a recursive statement just declaring 1.01 run a billion times will run into issues with memory allocation. That sounds insanely unlucky to happen, but if you dont get rid of variables you are using over time you have a left a lot of variables the processor has not optimized out of existence once used.
Even labview you do this. All those close vi's de-allocate all the cache you initialize.
Reply With Quote