Atmel CAVR-4 사용자 설명서
CAVR-4
112
Feature descriptions
AVR® IAR C/C++ Compiler
Reference Guide
Example
class B {
public:
void f();
int i;
};
Class memory
To compensate for this limitation, a class can be associated with a class memory type.
The class memory type changes:
The class memory type changes:
●
the
this
pointer type in all member functions, constructors, and destructors into a
pointer to class memory
●
the default memory for static storage duration variables—that is, not auto
variables—of the class type, into the specified class memory
variables—of the class type, into the specified class memory
●
the pointer type used for pointing to objects of the class type, into a pointer to class
memory.
memory.
Example
class _ _far C {
public:
void f(); // Has a this pointer of type C _ _far *
void f() const; // Has a this pointer of type
// C _ _far const *
C(); // Has a this pointer pointing into far
// memory
C(C const &); // Takes a parameter of type C _ _far const &
// (also true of generated copy constructor)
int i;
};
C Ca; // Resides in far memory instead of the
// default memory
C _ _near Cb; // Resides in near memory, the 'this'
// pointer still points into far memory
C _ _huge Cc; // Not allowed, _ _huge pointer can't be
// implicitly casted into a _ _far pointer
void h()
{
C Cd; // Resides on the stack
}
C * Cp; // Creates a pointer to far memory
C _ _near * Cp; // Creates a pointer to near memory