* @brief Multithreaded safe malloc * @param dwBytes Byte size to allocate */
| 938 | * @param dwBytes Byte size to allocate |
| 939 | */ |
| 940 | BYTE *DiabloAllocPtr(DWORD dwBytes) |
| 941 | { |
| 942 | BYTE *buf; |
| 943 | |
| 944 | sgMemCrit.Enter(); |
| 945 | buf = (BYTE *)SMemAlloc(dwBytes, __FILE__, __LINE__, 0); |
| 946 | sgMemCrit.Leave(); |
| 947 | |
| 948 | if (buf == NULL) { |
| 949 | char *text = "System memory exhausted.\n" |
| 950 | "Make sure you have at least 64MB of free system memory before running the game"; |
| 951 | ERR_DLG("Out of Memory Error", text); |
| 952 | } |
| 953 | |
| 954 | return buf; |
| 955 | } |
| 956 | |
| 957 | /** |
| 958 | * @brief Multithreaded safe memfree |
no test coverage detected