Advertisement
Guest User

Untitled

a guest
Nov 28th, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.95 KB | None | 0 0
  1.     const game_value invoker::invoke_raw(std::string function_name_)
  2.     {
  3.         LOG(DEBUG) << "Total memory count BEFORE call: " << total_memory_count << " bytes";
  4.         _CrtMemState s1, s2, s3;
  5.         _CrtMemCheckpoint(&s1);
  6.         //nular_function function;
  7.         //game_value return_value = game_value();
  8.         //if (loader::get().get_function(function_name_, function)) {
  9.         {
  10.             std::unique_lock<std::mutex> lock(_state_mutex);
  11.             _invoke_condition.wait(lock, [] {return invoker_accessisble;});
  12.             std::lock_guard<std::mutex> invoke_lock(_invoke_mutex);
  13.             //uintptr_t return_address = function(_sqf_this, _sqf_game_state);
  14.  
  15.             //_CrtMemCheckpoint(&s1);
  16.             //return_value.__vptr = *(uintptr_t *)return_address;
  17.             //return_value.data = (game_data *)*(uintptr_t *)(return_address + 4);
  18.             /*
  19.             _CrtMemCheckpoint(&s2);
  20.             if (_CrtMemDifference(&s3, &s1, &s2)) {
  21.                 //OutputDebugStringA("---Invoke Memory Difference\n");
  22.                 _CrtMemDumpStatistics(&s3);
  23.             }
  24.             else {
  25.                 //OutputDebugStringA("No Invoke Memory Difference\n");
  26.             }
  27.             for (int i = 0; i < _MAX_BLOCKS; ++i)
  28.                 total_memory_count += s3.lSizes[i];
  29.             LOG(DEBUG) << "Total memory count AFTER transfer: " << total_memory_count << " bytes";
  30.             */
  31.             //}
  32.         }
  33.         _CrtMemCheckpoint(&s2);
  34.         if (_CrtMemDifference(&s3, &s1, &s2)) {
  35.             //OutputDebugStringA("---Invoke Memory Difference\n");
  36.             _CrtMemDumpStatistics(&s3);
  37.         }
  38.         else {
  39.             //OutputDebugStringA("No Invoke Memory Difference\n");
  40.         }
  41.         for (int i = 0; i < _MAX_BLOCKS; ++i)
  42.             total_memory_count += s3.lSizes[i];
  43.         LOG(DEBUG) << "Total memory count AFTER call: " << total_memory_count << " bytes";
  44.         return game_value();
  45.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement