This commit is contained in:
Cameron Kaiser 2017-05-12 11:19:41 -07:00
parent 3c5d4bab84
commit a6a0b895f1

View File

@ -291,7 +291,7 @@ static inline char* js_strdup(const char* s)
QUALIFIERS T * \ QUALIFIERS T * \
NEWNAME(Args&&... args) MOZ_HEAP_ALLOCATOR { \ NEWNAME(Args&&... args) MOZ_HEAP_ALLOCATOR { \
void* memory = ALLOCATOR(sizeof(T)); \ void* memory = ALLOCATOR(sizeof(T)); \
return memory \ return MOZ_LIKELY(memory) \
? new(memory) T(mozilla::Forward<Args>(args)...) \ ? new(memory) T(mozilla::Forward<Args>(args)...) \
: nullptr; \ : nullptr; \
} }