hi everyone, i'm wondering if there is a way to have sure that a
variable is allocated in the cache, after its declaration with
"register"? Tks!
Not in standard C, and not using any extension I've ever heard of.
You posted the same question twice, with different subject headers,
about 6 minutes apart. Please don't do that.
Typically the compiler is the best judge of whether a variable should
be in a register, and interfering with its judgement with the
"register" keyword can be counterproductive.
Cache is something else; it's typically managed at execution time by
the hardware and/or the operating system. The whole point of cache is
that it looks like ordinary memory, except that it's faster. If the
compiler obeys the "register" keyword, the variable will be in a
register, *not* in cache.
Just what are you trying to accomplish?