/*Macro:*/ ADD_STORAGE(X)ADD_STORAGE() is used to allocate a space in memory. It takes only one argument namely the name of the data type for which storage is to be provided. The macro is used to implement things like object variables. The following example line of code placed in a class makes sure a storage for the struct number_and_letter is created upon each instantiation of the class.
/*Example of usage:*/
struct number_and_letter{
int number;
char letter;
};
ADD_STORAGE(number_and_letter);
The first ADD_STORAGE() that is placed in a class will yield a handle that
can be accessed for instance when writing a function for that class. This handle is kept track of so that the storage can be
accessed as long as the corresponding object exists. When writing the
implementation of a class this handle is then the Pike_fp-
current_storage variable.
If a second storage is added to a class, it will be found in an offset from the first storage. Same goes for a third storage if it is added. The programmer will have to keep track of the offsets manually.