Am Mittwoch, den 24.04.2019, 21:30 +0200 schrieb Philipp Klaus Krause: > Am 24.04.19 um 20:41 schrieb Jeff Law: > > > > > 4.) Compilers make sure that exposed objects never > > > > > are allocated next to each other (as Jens proposed). > > > > > > > > Ugh. Not sure how you enforce that. Consider that the compiler may > > > > ultimately have no control over layout of data in static storage. > > > > > > Make everything 1 byte larger. > > > > Not a bad idea. I suspect the embedded folks would go bananas though. > > > > Some of the systems the Small Device C compiler targets have just 60 B > of RAM. And we are curetnly considering adding support for a multicore > microcontroller, of which also variants with just 60 B of RAM exist. > But even for the other architectures supported in SDCC, where devices > tend to have much bigger RAM, in the range of 128B to even a few KB, > wasting memory like that is not acceptable.
It would not be a requirement, you could always do the pointer comparison at run-time or write a smarter compiler which not only uses provenance for optimization but also takes neighborhood relationships into accout. Martin