?? exception.cpp
字號:
#include <stdio.h>
#include "exception.h"
// check the validity of 'MAX_EXCEPTION_STACK_SIZE'
#if MAX_EXCEPTION_STACK_SIZE < 1
#error 'MAX_EXCEPTION_STACK_SIZE' was not properly configured. Please check "exception.h"!
#endif
#define ALIGN_MASK (0xffffffff ^ (MAX_EXCEPTION_STACK_SIZE*STACK_TYPE_SIZE))
_sys_ExceptStack::_sys_ExceptStack(void) :
tail(NULL),
front(NULL),
tempCounter(0)
{
tail = front = except_stack_queue;
bEmpty = true;
bFull = false;
}
_sys_ExceptStack::~_sys_ExceptStack(void)
{
}
void _sys_ExceptStack::AddException(void *pE)
{
if(bFull)
return;
if( ((ADDR)(front+1) & ALIGN_MASK) == (ADDR)tail )
bFull = true;
bEmpty = false;
*front++ = pE;
tempCounter++;
}
void* _sys_ExceptStack::GetException(void)
{
if(bEmpty)
return NULL;
if( ((ADDR)(tail+1) & ALIGN_MASK) == (ADDR)front )
bEmpty = true;
bFull = false;
void* value = *tail++;
tempCounter--;
return value;
}
_sys_ExceptStack __sysExceptionStack;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -