Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Oct 2017 22:36:26 -0700
From:      Matt Joras <mjoras@FreeBSD.org>
To:        "Ngie Cooper (yaneurabeya)" <yaneurabeya@gmail.com>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r324541 - in head: share/man/man9 sys/kern sys/sys
Message-ID:  <a8093059-86ed-1582-a8fa-3c9c8800e213@FreeBSD.org>
In-Reply-To: <365AD758-5761-4BD4-A80E-8EF2EA84EAAA@gmail.com>
References:  <201710112153.v9BLroeR007323@repo.freebsd.org> <365AD758-5761-4BD4-A80E-8EF2EA84EAAA@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 10/13/2017 22:12, Ngie Cooper (yaneurabeya) wrote:
>> Modified: head/sys/kern/subr_unit.c
>> ==============================================================================
>> --- head/sys/kern/subr_unit.c	Wed Oct 11 20:36:22 2017	(r324540)
>> +++ head/sys/kern/subr_unit.c	Wed Oct 11 21:53:50 2017	(r324541)
>> @@ -366,6 +366,27 @@ delete_unrhdr(struct unrhdr *uh)
>> 	Free(uh);
>> }
>>
>> +void
>> +clear_unrhdr(struct unrhdr *uh)
>> +{
>> +	struct unr *up, *uq;
>> +
>> +	KASSERT(TAILQ_EMPTY(&uh->ppfree),
>> +	    ("unrhdr has postponed item for free"));
>> +	up = TAILQ_FIRST(&uh->head);
>> +	while (up != NULL) {
> Could this be done with TAILQ_FOREACH_SAFE?
> -Ngie


Yes but it is arguably inferior to do so. This while loop is
theoretically faster since there is no need to individually remove the
elements when you intend to delete every element.

Matt




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a8093059-86ed-1582-a8fa-3c9c8800e213>