We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
I've a question regarding C programming on ARM processors. can I ALWAYS assume that the sizeof(function_pointers) == sizeof(void *) == sizeof(char *)? Also I read in a blog (Caches and Self-Modifying Code) that "ARM architecture is often considered to be a Modified Harvard Architecture" does this mean the instructions are placed in a different memory space than the data memory space? If so again how can we guarantee the sizeof (function_pointer) == sizeof(data_pointer)?
Thanks.
Well the futures not ours to see, but that holds at the moment and I'm pretty certain it'll stay that way. Yes sometimes there is memory that is just used for one or the other with ARM processors in what is called Tightly Coupled Memory (TCM). The huge amount of trouble that would be caused by having different sized pointers is your best guarantee. The only systems that sometimes do that are very specialized ones like DSPs and that was more common in the past where saving a few bits really meant something, it is very uncommon nowadays where having a good ecosystem with interfaces that can be shared is more important.