Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/xlint/lint1 lint: reduce comment for xgetblk to the ...
details: https://anonhg.NetBSD.org/src/rev/8ff99c25bd09
branches: trunk
changeset: 979662:8ff99c25bd09
user: rillig <rillig%NetBSD.org@localhost>
date: Mon Jan 04 22:29:00 2021 +0000
description:
lint: reduce comment for xgetblk to the actually interesting part
diffstat:
usr.bin/xlint/lint1/mem1.c | 23 +++++++++++++----------
1 files changed, 13 insertions(+), 10 deletions(-)
diffs (51 lines):
diff -r ea9451f626fb -r 8ff99c25bd09 usr.bin/xlint/lint1/mem1.c
--- a/usr.bin/xlint/lint1/mem1.c Mon Jan 04 22:26:50 2021 +0000
+++ b/usr.bin/xlint/lint1/mem1.c Mon Jan 04 22:29:00 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mem1.c,v 1.21 2020/12/30 10:46:11 rillig Exp $ */
+/* $NetBSD: mem1.c,v 1.22 2021/01/04 22:29:00 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mem1.c,v 1.21 2020/12/30 10:46:11 rillig Exp $");
+__RCSID("$NetBSD: mem1.c,v 1.22 2021/01/04 22:29:00 rillig Exp $");
#endif
#include <sys/types.h>
@@ -218,14 +218,7 @@
return mb;
}
-/*
- * Allocate new memory. If the first block of the list has not enough
- * free space, or there is no first block, get a new block. The new
- * block is taken from the free list or, if there is no block on the
- * free list, is allocated using xnewblk(). If a new block is allocated
- * it is initialized with zero. Blocks taken from the free list are
- * zero'd in xfreeblk().
- */
+/* Allocate new memory, initialized with zero. */
static void *
xgetblk(mbl_t **mbp, size_t s)
{
@@ -233,6 +226,16 @@
void *p;
size_t t = 0;
+ /*
+ * If the first block of the list has not enough free space,
+ * or there is no first block, get a new block. The new block
+ * is taken from the free list or, if there is no block on the
+ * free list, is allocated using xnewblk().
+ *
+ * If a new block is allocated it is initialized with zero.
+ * Blocks taken from the free list are zero'd in xfreeblk().
+ */
+
s = WORST_ALIGN(s);
if ((mb = *mbp) == NULL || mb->nfree < s) {
if ((mb = frmblks) == NULL || mb->size < s) {
Home |
Main Index |
Thread Index |
Old Index