Merge pull request #14458 from coryan/patch-1

Fix typo in constant name.
pull/14597/head
Vijay Pai 7 years ago committed by GitHub
commit 5cb1c97c0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/core/lib/gprpp/memory.h

@ -30,12 +30,12 @@
namespace grpc_core {
// The alignment of memory returned by gpr_malloc().
constexpr size_t kAllignmentForDefaultAllocationInBytes = 8;
constexpr size_t kAlignmentForDefaultAllocationInBytes = 8;
// Alternative to new, since we cannot use it (for fear of libstdc++)
template <typename T, typename... Args>
inline T* New(Args&&... args) {
void* p = alignof(T) > kAllignmentForDefaultAllocationInBytes
void* p = alignof(T) > kAlignmentForDefaultAllocationInBytes
? gpr_malloc_aligned(sizeof(T), alignof(T))
: gpr_malloc(sizeof(T));
return new (p) T(std::forward<Args>(args)...);
@ -45,7 +45,7 @@ inline T* New(Args&&... args) {
template <typename T>
inline void Delete(T* p) {
p->~T();
if (alignof(T) > kAllignmentForDefaultAllocationInBytes) {
if (alignof(T) > kAlignmentForDefaultAllocationInBytes) {
gpr_free_aligned(p);
} else {
gpr_free(p);

Loading…
Cancel
Save