wishlist: support for shorter pointers

Rafał Pietrak embedded@ztk-rp.eu
Tue Jul 4 16:15:42 GMT 2023



W dniu 4.07.2023 o 17:13, David Brown pisze:
[------------]
> 
> If you have a circular buffer, it is vastly more efficient to have an 
> array with no pointers or indices, and use head and tail indices to 
> track the current position.  But I'm not sure if that is what you are 
> looking for.  And you can use indices in fields for chaining, but the 
> syntax will be different.  (For some microcontrollers, the 
> multiplications involved in array index calculations can be an issue, 
> but not for ARM devices.)

Ring Buffers, yest and no. Thy have their uses, but at this particular 
case (my current project) using them is pointless. A little explanation: 
at this point I have an "object" (a structure, or rather a union of 
structures) with 6 pointers and some additional data. Those 6 pointers 
are entangled in something that look like "neural network" (although 
it's  NOT one). This structure is sort of a demo, a template. It's 
expected to grow somewhat for the real thing ... like 3-5 times current 
structure. This translates to  100-150 bytes each (from current 32bytes) 
with "big several" expected as total size of the system. And my target 
is 2K-RAM/4kRAM devices.

I don't imagine turning this web into any amount of RB. In my capacity, 
that'd make it unmanageable.

But this is just me. I though, people doing embedded out there face 
similar problems, and a nice compiler "pragma" into direction of named 
spaces/segments could really help here.

-R


More information about the Gcc mailing list