2006-10-15 22:26:51 +02:00
|
|
|
#ifndef _INCLUDE_SOURCEPAWN_COMPILER_TRACKER_H_
|
|
|
|
#define _INCLUDE_SOURCEPAWN_COMPILER_TRACKER_H_
|
|
|
|
|
2006-10-15 22:57:14 +02:00
|
|
|
#define MEMUSE_STATIC 0
|
|
|
|
#define MEMUSE_DYNAMIC 1
|
2006-10-15 22:26:51 +02:00
|
|
|
|
2006-10-15 22:57:14 +02:00
|
|
|
typedef struct memuse_s {
|
|
|
|
int type; /* MEMUSE_STATIC or MEMUSE_DYNAMIC */
|
|
|
|
int size; /* size of array for static (0 for dynamic) */
|
|
|
|
struct memuse_s *prev; /* previous block on the list */
|
|
|
|
} memuse_t;
|
2006-10-15 22:26:51 +02:00
|
|
|
|
2006-10-15 22:57:14 +02:00
|
|
|
typedef struct memuse_list_s {
|
|
|
|
struct memuse_list_s *prev; /* last used list */
|
|
|
|
memuse_t *head; /* head of the current list */
|
|
|
|
} memuse_list_t;
|
2006-10-15 22:26:51 +02:00
|
|
|
|
2006-10-15 22:57:14 +02:00
|
|
|
/**
|
|
|
|
* Heap functions
|
|
|
|
*/
|
2006-10-15 22:26:51 +02:00
|
|
|
void pushheaplist();
|
2006-10-15 22:57:14 +02:00
|
|
|
memuse_list_t *popsaveheaplist();
|
2006-10-15 22:26:51 +02:00
|
|
|
void popheaplist();
|
|
|
|
int markheap(int type, int size);
|
|
|
|
|
2006-10-15 22:57:14 +02:00
|
|
|
/**
|
|
|
|
* Stack functions
|
|
|
|
*/
|
|
|
|
void pushstacklist();
|
|
|
|
void popstacklist();
|
|
|
|
int markstack(int type, int size);
|
|
|
|
|
|
|
|
extern memuse_list_t *heapusage;
|
|
|
|
extern memuse_list_t *stackusage;
|
|
|
|
|
2006-10-15 22:26:51 +02:00
|
|
|
#endif //_INCLUDE_SOURCEPAWN_COMPILER_TRACKER_H_
|