opinion wanted about global vars
From: Capstar (spam0_at_eg.homeip.net)
Date: 09/17/03
- Next message: Paul Pluzhnikov: "Re: __thread keyword"
- Previous message: Pierre: ".h for win32"
- Next in thread: Thomas Stegen: "Re: opinion wanted about global vars"
- Reply: Thomas Stegen: "Re: opinion wanted about global vars"
- Reply: Julián Albo: "Re: opinion wanted about global vars"
- Reply: E. Robert Tisdale: "Re: opinion wanted about global vars"
- Reply: The Real OS/2 Guy: "Re: opinion wanted about global vars"
- Reply: Jack Klein: "Re: opinion wanted about global vars"
- Reply: André Pönitz: "Re: opinion wanted about global vars"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 17 Sep 2003 16:56:23 +0200
Hi,
I am working on an application, which will run embedded without an OS.
The app is build up out of a couple of well defined parts. At first I
wanted to keep those parts seperated and use opaque data types to
transfer information in between them.
At some stage I was stuck and needed to make a variable global, and I
also needed to make the struct declaration public to some other parts.
Looking through the code I found out that lots of functions, which were
intended to alter the data structure would contain only one or two
lines. So I wrote macros to speed things up.
Looking through the assembly I discovered that the compiler would leave
some function calls completely out because of the optimisation of the
code including the macro.
So now for my real question, what is your opinion on using global
variables/structures and macro's to access them in this sort of environment?
I normally try to avoid global variables as much as possible, but in
this case I see somereal advantages esspecially over the opaque data
approach.
Mark
- Next message: Paul Pluzhnikov: "Re: __thread keyword"
- Previous message: Pierre: ".h for win32"
- Next in thread: Thomas Stegen: "Re: opinion wanted about global vars"
- Reply: Thomas Stegen: "Re: opinion wanted about global vars"
- Reply: Julián Albo: "Re: opinion wanted about global vars"
- Reply: E. Robert Tisdale: "Re: opinion wanted about global vars"
- Reply: The Real OS/2 Guy: "Re: opinion wanted about global vars"
- Reply: Jack Klein: "Re: opinion wanted about global vars"
- Reply: André Pönitz: "Re: opinion wanted about global vars"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]