mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 21:23:06 +00:00
Initialize deferred_work_generated
As the code evolves, some code paths that have previously assigned deferred_work_generated may cease being reached. This would leave the value uninitialized. This change initializes the value for safety.
This commit is contained in:
committed by
Alexander Lapenkov
parent
912324a1ac
commit
c9ebff0fd6
@@ -157,8 +157,6 @@ pac_alloc_new_guarded(tsdn_t *tsdn, pac_t *pac, ehooks_t *ehooks, size_t size,
|
||||
static edata_t *
|
||||
pac_alloc_impl(tsdn_t *tsdn, pai_t *self, size_t size, size_t alignment,
|
||||
bool zero, bool guarded, bool *deferred_work_generated) {
|
||||
*deferred_work_generated = false;
|
||||
|
||||
pac_t *pac = (pac_t *)self;
|
||||
ehooks_t *ehooks = pac_ehooks_get(pac);
|
||||
|
||||
@@ -179,8 +177,6 @@ pac_expand_impl(tsdn_t *tsdn, pai_t *self, edata_t *edata, size_t old_size,
|
||||
pac_t *pac = (pac_t *)self;
|
||||
ehooks_t *ehooks = pac_ehooks_get(pac);
|
||||
|
||||
*deferred_work_generated = false;
|
||||
|
||||
size_t mapped_add = 0;
|
||||
size_t expand_amount = new_size - old_size;
|
||||
|
||||
@@ -221,8 +217,6 @@ pac_shrink_impl(tsdn_t *tsdn, pai_t *self, edata_t *edata, size_t old_size,
|
||||
|
||||
size_t shrink_amount = old_size - new_size;
|
||||
|
||||
*deferred_work_generated = false;
|
||||
|
||||
if (ehooks_split_will_fail(ehooks)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user