comparison src/nucleus/er_defs.h @ 7:0f80e1e4dce4

src/nucleus: library C code import from FreeNucleus package
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Jul 2018 20:57:33 +0000
parents
children
comparison
equal deleted inserted replaced
6:8b2a9a374324 7:0f80e1e4dce4
1
2 #ifndef ER_DEFS_H
3 #define ER_DEFS_H
4
5 #ifdef NU_DEBUG_MEMORY
6
7 /* NU_DEBUG_MEMORY can only service one memory pool each time it is
8 compiled. It will examine the memory pool NU_DEBUG_POOL points to.*/
9 #define NU_DEBUG_POOL System_Memory
10
11 typedef struct ER_DEBUG_ALLOCATION_STRUCT
12 {
13
14 /* prev is the link needed to maintain a linked list of all the
15 ER_DEBUG_ALLOCATION structures. The head of the list is the global
16 variable ERD_RecentAllocation. */
17 struct ER_DEBUG_ALLOCATION_STRUCT *prev;
18 /* size is the number of bytes used for the users memory allocation */
19 unsigned int size;
20 /* Assignes each allocation an unique ID */
21 unsigned long AllocSequenceCounter;
22 /* line and file refer to the place in the code where the call to the
23 allocation is made in the application. These variables are filled
24 in with compiler specific macros. */
25 unsigned long line;
26 const char * file;
27 /* head and foot contain the non-null terminated strings "HEAD" and
28 "FOOT" so this module can spot some instances where pointers write
29 to memory locations beyond thier bounds. data is the user's data
30 which the allocation call is intended. */
31 unsigned char head[4];
32 unsigned char data[1];
33
34 } ER_DEBUG_ALLOCATION;
35
36 #endif /* NU_DEBUG_MEMORY */
37
38 #endif /* ER_DEFS_H */
39