Advertisement
maujogador

Strong

Jun 23rd, 2016
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. struct StackSentinel
  2. {
  3.     private:
  4.         static const size_t kBufferSize = 16 * 1024;
  5.         uint8_t m_Buffer[kBufferSize];
  6.  
  7.     public:
  8.         StackSentinel();
  9.         ~StackSentinel();
  10. };
  11.  
  12. StackSentinel::StackSentinel()
  13. {
  14.     for (size_t i = 0; i < kBufferSize; i++)
  15.         m_Buffer[i] = 0xDD;
  16. }
  17.  
  18. StackSentinel::~StackSentinel()
  19. {
  20.     for (size_t i = 0; i < kBufferSize; i++)
  21.     {
  22.         if (m_buffer[i] != 0xDD)
  23.             _debugbreak();
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement