1
0
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:
Alasdair Kergon 2006-08-18 21:38:58 +00:00
parent 461a997b5b
commit a945f1fde2
2 changed files with 11 additions and 9 deletions

View File

@ -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
==============================

View File

@ -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;