I know this isnt necessarily an issue with GDK but I am using it to make a game so I thought someone here may be able to help me.
Basically I have an STL list and every second I am pushing an object into it. I set up a timer that takes the time in milliseconds right before the new keyword call to build the object. Then inside of the object constructor I store the difference between that time taken and the current clock time FIRST on the initialization list. So I would assume this happens right after memory allocation. Correct me if I am wrong.
So the problem is this. As items are pushed into the list the time for allocation grows from 11ms to over 100ms. That is until the total memory used by my program reaches 65mb. Once that happens the allocation time drops back to 11ms and stays there. This seems very strange to me. I have not included any code because there is no code between the timer start and end. The only thing that happens is the memory allocation.
Any help would be appreciated and if there is somewhere better to post this please let me know. Thanks
UPDATE:
So I have now tried turning the list into a vector, changing from storing pointers to storing objects and changing what object is actually being stored. The problem remains unchanged....
UPDATE:
I don't know if anyone really cares, but for the curious out there I figured out a solution. I realized that a fairly processor expensive task was being done in a member object construction that didnt need to be done except the first time. I I overloaded the constructor for this and now this runs in less than 1 ms