A utility function for allocating memory, checking for allocation failures, and ensuring the contents are zeroed.
| 35 | /// A utility function for allocating memory, checking for allocation failures, |
| 36 | /// and ensuring the contents are zeroed. |
| 37 | inline static uint64_t* getClearedMemory(unsigned numWords) { |
| 38 | uint64_t *result = new uint64_t[numWords]; |
| 39 | memset(result, 0, numWords * sizeof(uint64_t)); |
| 40 | return result; |
| 41 | } |
| 42 | |
| 43 | /// A utility function for allocating memory and checking for allocation |
| 44 | /// failure. The content is not zeroed. |
no outgoing calls
no test coverage detected