This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C Programming and pointer sizes on ARM processors.

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.

Parents
  • 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.

Reply
  • 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.

Children
No data