View Single Post
  #9   Spotlight this post!  
Unread 01-01-2010, 18:58
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: replace WPILib part

Quote:
Originally Posted by slavik262 View Post
Just out of curiosity, why are you making them all inline?
the clones are inline to only (hopefully) incur 1 function call, because they are small, and call the main function
normal:
Auto()
> var("x",5)
> > AddDebugVariable("x",5)
> > > AddDebugVariable("x","5")
> > > > Add("dbg","x: 5")

Inline:
Auto()
var("x",5)
AddDebugVariable("x",5)
AddDebugVariable("x","5")
> Add("dbg","x: 5")

Normal makes 4 function calls, Inline only 1
EDIT: I accidentally put inline on void Add(const char* name, const char* value); instead of void AddDebugVariable(const char* name, const char* value);
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib

Last edited by byteit101 : 01-01-2010 at 19:02.
Reply With Quote