Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Apr 2016 20:12:46 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r298292 - head/libexec/rtld-elf
Message-ID:  <201604192012.u3JKCkE0033739@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Tue Apr 19 20:12:46 2016
New Revision: 298292
URL: https://svnweb.freebsd.org/changeset/base/298292

Log:
  rtld-elf: use our roundup2() macro when param.h is available.

Modified:
  head/libexec/rtld-elf/malloc.c

Modified: head/libexec/rtld-elf/malloc.c
==============================================================================
--- head/libexec/rtld-elf/malloc.c	Tue Apr 19 19:22:07 2016	(r298291)
+++ head/libexec/rtld-elf/malloc.c	Tue Apr 19 20:12:46 2016	(r298292)
@@ -224,7 +224,7 @@ malloc(nbytes)
 	 * Record allocated size of block and
 	 * bound space with magic numbers.
 	 */
-	op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1);
+	op->ov_size = roundup2(nbytes, RSLOP);
 	op->ov_rmagic = RMAGIC;
   	*(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC;
 #endif
@@ -388,7 +388,7 @@ realloc(cp, nbytes)
 		}
 		if (nbytes <= onb && nbytes > (size_t)i) {
 #ifdef RCHECK
-			op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1);
+			op->ov_size = roundup2(nbytes, RSLOP);
 			*(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC;
 #endif
 			return(cp);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604192012.u3JKCkE0033739>