Is there a way to specify that all member functions for a class or template are placed in a specific region? Specifying a section for each member function works, but makes maintenance of large classes more tedious. Ideally there should be a way to do this for all functions in a class or template. In the example below square() is placed in "sram2" but cube() is not. Thanks.
#pragma arm section code = "sram2" class foo { public: int __attribute__((section("sram2"))) square(int x) { return x * x; } int cube(int x) { return x * x * x; } }; #pragma arm section code
Wouldn't it be a good solution to put this class in a separate source file and have that object file tagged for a specific memory region?
If you want the code inlined, then you would normally not want it in a specific memory region, but in the currrent memory region used for the code that makes use of the inlined functionality.