This is a general C++ question, I think.
If you allocate memory for a class and the class has functions, in other words the class has code, there are couple of questions. Actually every class has code because there is a constructor and destructor.
gameterrain = (class TerrainElement *)IExec->AllocVecTags(sizeof(TerrainElement),
1. Does it allocate memory for the functions?
2. Does it copy the code for the function to the memory?
3. Where does the code come from? Do you end up with two copies of the code?