Lines Matching refs:count
38 explicit AutoTMalloc(size_t count) : fPtr(mallocIfCountThrowOnFail(count)) {} in AutoTMalloc() argument
44 void realloc(size_t count) { fPtr.reset(reallocIfCountThrowOnFail(count)); } in realloc() argument
47 T* reset(size_t count = 0) {
48 fPtr.reset(mallocIfCountThrowOnFail(count));
75 T* mallocIfCountThrowOnFail(size_t count) { in mallocIfCountThrowOnFail() argument
77 if (count) { in mallocIfCountThrowOnFail()
78 newPtr = (T*)std::malloc(count * sizeof(T)); in mallocIfCountThrowOnFail()
79 LOG_ALWAYS_FATAL_IF(!newPtr, "failed to malloc %zu bytes", count * sizeof(T)); in mallocIfCountThrowOnFail()
83 T* reallocIfCountThrowOnFail(size_t count) { in reallocIfCountThrowOnFail() argument
85 if (count) { in reallocIfCountThrowOnFail()
86 newPtr = (T*)std::realloc(fPtr.release(), count * sizeof(T)); in reallocIfCountThrowOnFail()
87 LOG_ALWAYS_FATAL_IF(!newPtr, "failed to realloc %zu bytes", count * sizeof(T)); in reallocIfCountThrowOnFail()