mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-05 01:46:16 +03:00
Remove dead stores detected by static analysis
None of these are harmful, and they are almost certainly optimized away by the compiler. The motivation for fixing them anyway is that we'd like to enable static analysis as part of CI, and the first step towards that is resolving the warnings it produces at present.
This commit is contained in:
parent
0288126d9c
commit
3e2ba7a651
6 changed files with 7 additions and 13 deletions
|
|
@ -68,7 +68,6 @@ static int madvise_dont_need_zeros_is_faulty = -1;
|
|||
*/
|
||||
static int madvise_MADV_DONTNEED_zeroes_pages()
|
||||
{
|
||||
int works = -1;
|
||||
size_t size = PAGE;
|
||||
|
||||
void * addr = mmap(NULL, size, PROT_READ|PROT_WRITE,
|
||||
|
|
@ -83,6 +82,7 @@ static int madvise_MADV_DONTNEED_zeroes_pages()
|
|||
}
|
||||
|
||||
memset(addr, 'A', size);
|
||||
int works;
|
||||
if (madvise(addr, size, MADV_DONTNEED) == 0) {
|
||||
works = memchr(addr, 'A', size) == NULL;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue