| 19 | |
| 20 | |
| 21 | void AddTrack(unsigned long addr, unsigned long size, const char *file, unsigned long line) |
| 22 | { |
| 23 | ALLOC_INFO *Temp; |
| 24 | |
| 25 | if (AllocList == NULL) { |
| 26 | AllocList = (ALLOC_INFO*)malloc(sizeof(ALLOC_INFO)); // Just assume it succeeds. |
| 27 | AllocList->address = addr; |
| 28 | AllocList->size = size; |
| 29 | AllocList->line = line; |
| 30 | strncpy(AllocList->file, file, 63); |
| 31 | AllocList->Next = NULL; |
| 32 | } |
| 33 | else { |
| 34 | Temp = AllocList; |
| 35 | AllocList = (ALLOC_INFO*)malloc(sizeof(ALLOC_INFO)); // Just assume it succeeds. |
| 36 | AllocList->address = addr; |
| 37 | AllocList->size = size; |
| 38 | AllocList->line = line; |
| 39 | strncpy(AllocList->file, file, 63); |
| 40 | AllocList->Next = Temp; |
| 41 | } |
| 42 | |
| 43 | return; |
| 44 | } |
| 45 | |
| 46 | |
| 47 | void RemoveTrack(unsigned long addr) |