mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-14 22:30:01 -04:00
[9.20] fix: dev: Rename variable called 'free' to prevent the clash with free()
Backport of MR !10756 Merge branch 'backport-ondrej/rename-variable-called-free-9.20' into 'bind-9.20' See merge request isc-projects/bind9!10757
This commit is contained in:
commit
7f25d92c5d
2 changed files with 21 additions and 20 deletions
30
lib/dns/qp.c
30
lib/dns/qp.c
|
|
@ -664,7 +664,7 @@ chunk_free(dns_qp_t *qp, dns_qpchunk_t chunk) {
|
|||
*/
|
||||
static void
|
||||
recycle(dns_qp_t *qp) {
|
||||
unsigned int free = 0;
|
||||
unsigned int nfree = 0;
|
||||
|
||||
isc_nanosecs_t start = isc_time_monotonic();
|
||||
|
||||
|
|
@ -673,15 +673,15 @@ recycle(dns_qp_t *qp) {
|
|||
qp->usage[chunk].exists && !qp->usage[chunk].immutable)
|
||||
{
|
||||
chunk_free(qp, chunk);
|
||||
free++;
|
||||
nfree++;
|
||||
}
|
||||
}
|
||||
|
||||
isc_nanosecs_t time = isc_time_monotonic() - start;
|
||||
atomic_fetch_add_relaxed(&recycle_time, time);
|
||||
|
||||
if (free > 0) {
|
||||
LOG_STATS("qp recycle" PRItime "free %u chunks", time, free);
|
||||
if (nfree > 0) {
|
||||
LOG_STATS("qp recycle" PRItime "free %u chunks", time, nfree);
|
||||
LOG_STATS("qp recycle leaf %u live %u used %u free %u hold %u",
|
||||
qp->leaf_count, qp->used_count - qp->free_count,
|
||||
qp->used_count, qp->free_count, qp->hold_count);
|
||||
|
|
@ -703,7 +703,7 @@ reclaim_chunks_cb(struct rcu_head *arg) {
|
|||
dns_qp_t *qp = &multi->writer;
|
||||
REQUIRE(QP_VALID(qp));
|
||||
|
||||
unsigned int free = 0;
|
||||
unsigned int nfree = 0;
|
||||
isc_nanosecs_t start = isc_time_monotonic();
|
||||
|
||||
for (unsigned int i = 0; i < rcuctx->count; i++) {
|
||||
|
|
@ -713,7 +713,7 @@ reclaim_chunks_cb(struct rcu_head *arg) {
|
|||
qp->usage[chunk].snapfree = true;
|
||||
} else {
|
||||
chunk_free(qp, chunk);
|
||||
free++;
|
||||
nfree++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -723,8 +723,8 @@ reclaim_chunks_cb(struct rcu_head *arg) {
|
|||
isc_nanosecs_t time = isc_time_monotonic() - start;
|
||||
recycle_time += time;
|
||||
|
||||
if (free > 0) {
|
||||
LOG_STATS("qp reclaim" PRItime "free %u chunks", time, free);
|
||||
if (nfree > 0) {
|
||||
LOG_STATS("qp reclaim" PRItime "free %u chunks", time, nfree);
|
||||
LOG_STATS("qp reclaim leaf %u live %u used %u free %u hold %u",
|
||||
qp->leaf_count, qp->used_count - qp->free_count,
|
||||
qp->used_count, qp->free_count, qp->hold_count);
|
||||
|
|
@ -786,7 +786,7 @@ reclaim_chunks(dns_qpmulti_t *multi) {
|
|||
*/
|
||||
static void
|
||||
marksweep_chunks(dns_qpmulti_t *multi) {
|
||||
unsigned int free = 0;
|
||||
unsigned int nfree = 0;
|
||||
|
||||
isc_nanosecs_t start = isc_time_monotonic();
|
||||
|
||||
|
|
@ -809,15 +809,15 @@ marksweep_chunks(dns_qpmulti_t *multi) {
|
|||
qpw->usage[chunk].snapmark = false;
|
||||
if (qpw->usage[chunk].snapfree && !qpw->usage[chunk].snapshot) {
|
||||
chunk_free(qpw, chunk);
|
||||
free++;
|
||||
nfree++;
|
||||
}
|
||||
}
|
||||
|
||||
isc_nanosecs_t time = isc_time_monotonic() - start;
|
||||
recycle_time += time;
|
||||
|
||||
if (free > 0) {
|
||||
LOG_STATS("qp marksweep" PRItime "free %u chunks", time, free);
|
||||
if (nfree > 0) {
|
||||
LOG_STATS("qp marksweep" PRItime "free %u chunks", time, nfree);
|
||||
LOG_STATS(
|
||||
"qp marksweep leaf %u live %u used %u free %u hold %u",
|
||||
qpw->leaf_count, qpw->used_count - qpw->free_count,
|
||||
|
|
@ -1254,7 +1254,7 @@ dns_qpmulti_commit(dns_qpmulti_t *multi, dns_qp_t **qptp) {
|
|||
*/
|
||||
void
|
||||
dns_qpmulti_rollback(dns_qpmulti_t *multi, dns_qp_t **qptp) {
|
||||
unsigned int free = 0;
|
||||
unsigned int nfree = 0;
|
||||
|
||||
REQUIRE(QPMULTI_VALID(multi));
|
||||
REQUIRE(multi->writer.transaction_mode == QP_UPDATE);
|
||||
|
|
@ -1277,7 +1277,7 @@ dns_qpmulti_rollback(dns_qpmulti_t *multi, dns_qp_t **qptp) {
|
|||
INSIST(!multi->rollback->usage[chunk].exists);
|
||||
multi->rollback->base->ptr[chunk] = NULL;
|
||||
}
|
||||
free++;
|
||||
nfree++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1300,7 +1300,7 @@ dns_qpmulti_rollback(dns_qpmulti_t *multi, dns_qp_t **qptp) {
|
|||
isc_nanosecs_t time = isc_time_monotonic() - start;
|
||||
atomic_fetch_add_relaxed(&rollback_time, time);
|
||||
|
||||
LOG_STATS("qp rollback" PRItime "free %u chunks", time, free);
|
||||
LOG_STATS("qp rollback" PRItime "free %u chunks", time, nfree);
|
||||
|
||||
*qptp = NULL;
|
||||
UNLOCK(&multi->mutex);
|
||||
|
|
|
|||
|
|
@ -177,8 +177,8 @@ qp_test_dumpmulti(dns_qpmulti_t *multi) {
|
|||
|
||||
void
|
||||
qp_test_dumpchunks(dns_qp_t *qp) {
|
||||
dns_qpcell_t used = 0;
|
||||
dns_qpcell_t free = 0;
|
||||
dns_qpcell_t used_count = 0;
|
||||
dns_qpcell_t free_count = 0;
|
||||
dumpqp(qp, "qp");
|
||||
for (dns_qpchunk_t c = 0; c < qp->chunk_max; c++) {
|
||||
printf("qp %p chunk %u base %p "
|
||||
|
|
@ -186,10 +186,11 @@ qp_test_dumpchunks(dns_qp_t *qp) {
|
|||
qp, c, qp->base->ptr[c], qp->usage[c].used,
|
||||
qp->usage[c].free, qp->usage[c].immutable,
|
||||
qp->usage[c].discounted);
|
||||
used += qp->usage[c].used;
|
||||
free += qp->usage[c].free;
|
||||
used_count += qp->usage[c].used;
|
||||
free_count += qp->usage[c].free;
|
||||
}
|
||||
printf("qp %p total used %u free %u\n", qp, used, free);
|
||||
printf("qp %p total used %" PRIu32 " free %" PRIu32 "\n", qp,
|
||||
used_count, free_count);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue