Cleanup: use braces (follow own style guide)
This commit is contained in:
@@ -561,8 +561,9 @@ void *MEM_guarded_mallocN(size_t len, const char *str)
|
||||
}
|
||||
|
||||
#ifdef DEBUG_MEMCOUNTER
|
||||
if (_mallocn_count == DEBUG_MEMCOUNTER_ERROR_VAL)
|
||||
if (_mallocn_count == DEBUG_MEMCOUNTER_ERROR_VAL) {
|
||||
memcount_raise(__func__);
|
||||
}
|
||||
memh->_count = _mallocn_count++;
|
||||
#endif
|
||||
return (++memh);
|
||||
@@ -651,8 +652,9 @@ void *MEM_guarded_mallocN_aligned(size_t len,
|
||||
}
|
||||
|
||||
#ifdef DEBUG_MEMCOUNTER
|
||||
if (_mallocn_count == DEBUG_MEMCOUNTER_ERROR_VAL)
|
||||
if (_mallocn_count == DEBUG_MEMCOUNTER_ERROR_VAL) {
|
||||
memcount_raise(__func__);
|
||||
}
|
||||
memh->_count = _mallocn_count++;
|
||||
#endif
|
||||
return (++memh);
|
||||
@@ -675,8 +677,9 @@ void *MEM_guarded_callocN(size_t len, const char *str)
|
||||
if (memh) {
|
||||
make_memhead_header(memh, len, str, AllocationType::ALLOC_FREE);
|
||||
#ifdef DEBUG_MEMCOUNTER
|
||||
if (_mallocn_count == DEBUG_MEMCOUNTER_ERROR_VAL)
|
||||
if (_mallocn_count == DEBUG_MEMCOUNTER_ERROR_VAL) {
|
||||
memcount_raise(__func__);
|
||||
}
|
||||
memh->_count = _mallocn_count++;
|
||||
#endif
|
||||
return (++memh);
|
||||
@@ -1000,8 +1003,9 @@ short MEM_guarded_testN(void *vmemh)
|
||||
mem_lock_thread();
|
||||
|
||||
membl = membase->first;
|
||||
if (membl)
|
||||
if (membl) {
|
||||
membl = MEMNEXT(membl);
|
||||
}
|
||||
|
||||
while (membl) {
|
||||
if (vmemh == membl + 1) {
|
||||
@@ -1126,10 +1130,12 @@ static void addtail(volatile localListBase *listbase, void *vlink)
|
||||
/* for a generic API error checks here is fine but
|
||||
* the limited use here they will never be nullptr */
|
||||
#if 0
|
||||
if (link == nullptr)
|
||||
if (link == nullptr) {
|
||||
return;
|
||||
if (listbase == nullptr)
|
||||
}
|
||||
if (listbase == nullptr) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
link->next = nullptr;
|
||||
@@ -1151,10 +1157,12 @@ static void remlink(volatile localListBase *listbase, void *vlink)
|
||||
/* for a generic API error checks here is fine but
|
||||
* the limited use here they will never be nullptr */
|
||||
#if 0
|
||||
if (link == nullptr)
|
||||
if (link == nullptr) {
|
||||
return;
|
||||
if (listbase == nullptr)
|
||||
}
|
||||
if (listbase == nullptr) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (link->next) {
|
||||
@@ -1190,8 +1198,9 @@ static void rem_memblock(MemHead *memh)
|
||||
atomic_sub_and_fetch_z(&mem_in_use, memh->len);
|
||||
|
||||
#ifdef DEBUG_MEMDUPLINAME
|
||||
if (memh->need_free_name)
|
||||
if (memh->need_free_name) {
|
||||
free((char *)memh->name);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (UNLIKELY(malloc_debug_memset && memh->len)) {
|
||||
|
||||
Reference in New Issue
Block a user