00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef _TRACE_FRACE_H_
00036 #define _TRACE_FRAME_H_
00037
00038 #include "../main/includes.h"
00039 #include "../allocator/allocator.h"
00040 #include "../main/const.h"
00041
00050 struct TraceFrame {
00051
00053 jint lineno;
00054
00056 Method* method;
00057
00058 #ifdef USE_ALLOCATOR
00059 private:
00060
00062 static Allocator _allocators[MAX_TRACE];
00063 #endif
00064
00065 public:
00066
00071 static TraceFrame* newArray(int size) {
00072
00073 #ifdef USE_ALLOCATOR
00074 return reinterpret_cast<TraceFrame*>(_allocators[size-1].get(size*sizeof(TraceFrame)));
00075 #else
00076 return ::new TraceFrame[size];
00077 #endif
00078 }
00079
00085 static void deleteArray(TraceFrame* array, int size) {
00086
00087 #ifdef USE_ALLOCATOR
00088 _allocators[size-1].put( reinterpret_cast<void*>(array));
00089 #else
00090 ::delete[] array;
00091 #endif
00092 }
00093 };
00094
00095 #endif // _TRACE_FRAME_H_