mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
reorder bounds check code
This commit is contained in:
parent
461a997b5b
commit
a945f1fde2
@ -1,5 +1,6 @@
|
||||
Version 1.02.10 -
|
||||
==============================
|
||||
Reorder mm bounds_check code to reduce window for a dmeventd race.
|
||||
|
||||
Version 1.02.09 - 15 Aug 2006
|
||||
==============================
|
||||
|
@ -77,15 +77,6 @@ void *dm_malloc_aux_debug(size_t s, const char *file, int line)
|
||||
nb->length = s;
|
||||
nb->id = ++_mem_stats.block_serialno;
|
||||
nb->next = 0;
|
||||
nb->prev = _tail;
|
||||
|
||||
/* link to tail of the list */
|
||||
if (!_head)
|
||||
_head = _tail = nb;
|
||||
else {
|
||||
_tail->next = nb;
|
||||
_tail = nb;
|
||||
}
|
||||
|
||||
/* stomp a pretty pattern across the new memory
|
||||
and fill in the boundary bytes */
|
||||
@ -99,6 +90,16 @@ void *dm_malloc_aux_debug(size_t s, const char *file, int line)
|
||||
*ptr++ = (char) nb->id;
|
||||
}
|
||||
|
||||
nb->prev = _tail;
|
||||
|
||||
/* link to tail of the list */
|
||||
if (!_head)
|
||||
_head = _tail = nb;
|
||||
else {
|
||||
_tail->next = nb;
|
||||
_tail = nb;
|
||||
}
|
||||
|
||||
_mem_stats.blocks_allocated++;
|
||||
if (_mem_stats.blocks_allocated > _mem_stats.blocks_max)
|
||||
_mem_stats.blocks_max = _mem_stats.blocks_allocated;
|
||||
|
Loading…
Reference in New Issue
Block a user