* Allocates a new fixed-size array of the given size. If this size is * less than or equal to the template parameter STACK_BYTE_COUNT, an * internal on-stack buffer will be used. Otherwise a heap buffer will * be allocated. */
| 38 | * be allocated. |
| 39 | */ |
| 40 | LocalArray(size_t desiredByteCount) : mSize(desiredByteCount) { |
| 41 | if (desiredByteCount > STACK_BYTE_COUNT) { |
| 42 | mPtr = new char[mSize]; |
| 43 | } else { |
| 44 | mPtr = &mOnStackBuffer[0]; |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Frees the heap-allocated buffer, if there was one. |
nothing calls this directly
no outgoing calls
no test coverage detected