// if found, succs[0..foundLayer] need to point to the cached foundNode,
// as foundNode might be deleted at the same time thus pred->skip() can
- // return NULL or another node.
+ // return nullptr or another node.
succs[layer] = foundNode ? foundNode : node;
}
return foundLayer;
/**
* Declare *allocx() and mallctl*() as weak symbols. These will be provided by
- * jemalloc if we are using jemalloc, or will be NULL if we are using another
+ * jemalloc if we are using jemalloc, or will be nullptr if we are using another
* malloc implementation.
*/
extern "C" void* mallocx(size_t, int)
* Determine if we are using jemalloc or not.
*/
FOLLY_MALLOC_NOINLINE inline bool usingJEMalloc() noexcept {
- // Checking for rallocx != NULL is not sufficient; we may be in a dlopen()ed
- // module that depends on libjemalloc, so rallocx is resolved, but the main
- // program might be using a different memory allocator.
+ // Checking for rallocx != nullptr is not sufficient; we may be in a
+ // dlopen()ed module that depends on libjemalloc, so rallocx is resolved, but
+ // the main program might be using a different memory allocator.
// How do we determine that we're using jemalloc? In the hackiest
// way possible. We allocate memory using malloc() and see if the
// per-thread counter of allocated memory increases. This makes me
/**
* Attempts to acquire for a given number of milliseconds. If
- * acquisition is unsuccessful, the returned LockedPtr is NULL.
+ * acquisition is unsuccessful, the returned LockedPtr is nullptr.
*
* NOTE: This API is deprecated. Use lock(), wlock(), or rlock() instead.
* In the future it will be marked with a deprecation attribute to emit
/**
* Attempts to acquire for a given number of milliseconds. If
- * acquisition is unsuccessful, the returned ConstLockedPtr is NULL.
+ * acquisition is unsuccessful, the returned ConstLockedPtr is nullptr.
*
* NOTE: This API is deprecated. Use lock(), wlock(), or rlock() instead.
* In the future it will be marked with a deprecation attribute to emit
// Dependent exceptions (thrown via std::rethrow_exception) aren't
// standard ABI __cxa_exception objects, and are correctly labeled as
// such in the exception_class field. We could try to extract the
- // primary exception type in horribly hacky ways, but, for now, NULL.
+ // primary exception type in horribly hacky ways, but, for now, nullptr.
info.type =
isAbiCppException(currentException) ?
currentException->exceptionType :
// Open the ELF file.
// Returns 0 on success, kSystemError (guaranteed to be -1) (and sets errno)
// on IO error, kInvalidElfFile (and sets errno to EINVAL) for an invalid
- // Elf file. On error, if msg is not NULL, sets *msg to a static string
+ // Elf file. On error, if msg is not nullptr, sets *msg to a static string
// indicating what failed.
enum {
kSuccess = 0,
void* IOBuf::operator new(size_t size) {
size_t fullSize = offsetof(HeapStorage, buf) + size;
auto* storage = static_cast<HeapStorage*>(malloc(fullSize));
- // operator new is not allowed to return NULL
+ // operator new is not allowed to return nullptr
if (UNLIKELY(storage == nullptr)) {
throw std::bad_alloc();
}
return 0;
}
BIO* next = BIO_next(b);
- while (next != NULL) {
+ while (next != nullptr) {
b = next;
next = BIO_next(b);
}
// The value 'current_base' (libevent 1) or
// 'event_global_current_base_' (libevent 2) is filled in by event_set(),
// allowing examination of its value without an explicit reference here.
- // If ev.ev_base is NULL, then event_init() must be called, otherwise
+ // If ev.ev_base is nullptr, then event_init() must be called, otherwise
// call event_base_new().
event_set(&ev, 0, 0, nullptr, nullptr);
if (!ev.ev_base) {
// This is taken from OpenSSL 1.1.0
int DH_set0_pqg(DH* dh, BIGNUM* p, BIGNUM* q, BIGNUM* g) {
- /* If the fields p and g in d are NULL, the corresponding input
- * parameters MUST be non-NULL. q may remain NULL.
+ /* If the fields p and g in d are nullptr, the corresponding input
+ * parameters MUST not be nullptr. q may remain nullptr.
*/
if (dh == nullptr || (dh->p == nullptr && p == nullptr) ||
(dh->g == nullptr && g == nullptr)) {
* Get the bucket that the specified percentile falls into
*
* The lowest and highest percentile data points in returned bucket will be
- * returned in the lowPct and highPct arguments, if they are non-NULL.
+ * returned in the lowPct and highPct arguments, if they are not nullptr.
*/
size_t getPercentileBucketIdx(
double pct,