| 889 | } |
| 890 | |
| 891 | static struct debugmemallocs *getallocblock(void) |
| 892 | { |
| 893 | int round = 0; |
| 894 | alloccnt++; |
| 895 | if (alloccnt >= MAX_DEBUGMEMALLOCS) { |
| 896 | alloccnt = 1; |
| 897 | } |
| 898 | while (allocs[alloccnt]->id != 0) { |
| 899 | alloccnt++; |
| 900 | if (alloccnt >= MAX_DEBUGMEMALLOCS) { |
| 901 | alloccnt = 1; |
| 902 | if (round) { |
| 903 | console_out_f(_T("debugmem out of alloc blocks!\n")); |
| 904 | return NULL; |
| 905 | } |
| 906 | round++; |
| 907 | } |
| 908 | } |
| 909 | struct debugmemallocs *dm = allocs[alloccnt]; |
| 910 | dm->id = alloccnt; |
| 911 | return dm; |
| 912 | } |
| 913 | |
| 914 | static struct debugmemallocs *debugmem_allocate(uae_u32 size, uae_u32 flags, uae_u32 parentid) |
| 915 | { |
no test coverage detected