From 73461f2594e931feb0e621f047df07ebd916ead9 Mon Sep 17 00:00:00 2001 From: jasone Date: Wed, 19 Aug 2015 00:06:46 +0000 Subject: [PATCH] Fix minor malloc regressions. - Use _Bool rather than bool to resolve missing type errors in malloc_np.h. - Fix malloc manual page #include documentation. - Add *allocm manual pages to obsolete files. Submitted by: jbeich --- ObsoleteFiles.inc | 6 ++++++ contrib/jemalloc/FREEBSD-diffs | 13 ++++++++++--- contrib/jemalloc/FREEBSD-upgrade | 6 +++--- contrib/jemalloc/doc/jemalloc.3 | 7 ++++--- include/malloc_np.h | 15 ++++++++------- 5 files changed, 31 insertions(+), 16 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 96bfbb651cb2..f8021065361f 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -38,6 +38,12 @@ # xargs -n1 | sort | uniq -d; # done +# 20150818: *allocm() are gone in jemalloc 4.0.0 +OLD_FILES+=usr/share/man/man3/allocm.3.gz +OLD_FILES+=usr/share/man/man3/dallocm.3.gz +OLD_FILES+=usr/share/man/man3/nallocm.3.gz +OLD_FILES+=usr/share/man/man3/rallocm.3.gz +OLD_FILES+=usr/share/man/man3/sallocm.3.gz # 20150802: Remove netbsd's test on pw(8) OLD_FILES+=usr/tests/usr.sbin/pw/pw_test # 20150719: Remove libarchive.pc diff --git a/contrib/jemalloc/FREEBSD-diffs b/contrib/jemalloc/FREEBSD-diffs index 58f5f6fc08a0..7d6955d773b2 100644 --- a/contrib/jemalloc/FREEBSD-diffs +++ b/contrib/jemalloc/FREEBSD-diffs @@ -1,8 +1,8 @@ diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in -index 8fc774b..47b453c 100644 +index 8fc774b..fdbef95 100644 --- a/doc/jemalloc.xml.in +++ b/doc/jemalloc.xml.in -@@ -53,6 +53,17 @@ +@@ -53,11 +53,23 @@ This manual describes jemalloc @jemalloc_version@. More information can be found at the jemalloc website. @@ -20,7 +20,14 @@ index 8fc774b..47b453c 100644 SYNOPSIS -@@ -2759,4 +2770,18 @@ malloc_conf = "lg_chunk:24";]]> + +- #include <jemalloc/jemalloc.h> ++ #include <stdlib.h> ++#include <malloc_np.h> + + Standard API + +@@ -2759,4 +2771,18 @@ malloc_conf = "lg_chunk:24";]]> The posix_memalign function conforms to IEEE Std 1003.1-2001 (“POSIX.1”). diff --git a/contrib/jemalloc/FREEBSD-upgrade b/contrib/jemalloc/FREEBSD-upgrade index 370719e7c0e7..6ee6cc91e42e 100755 --- a/contrib/jemalloc/FREEBSD-upgrade +++ b/contrib/jemalloc/FREEBSD-upgrade @@ -72,9 +72,9 @@ do_extract() { patch -p1 < "${src}/FREEBSD-diffs" find . -name '*.orig' -delete # Generate various files. - ./autogen.sh --enable-cc-silence --enable-dss --enable-xmalloc \ - --enable-utrace --with-xslroot=/usr/local/share/xsl/docbook \ - --with-private-namespace=__ --with-lg-page-sizes=12,13,14,16 + ./autogen.sh --enable-cc-silence --enable-xmalloc --enable-utrace \ + --with-xslroot=/usr/local/share/xsl/docbook --with-private-namespace=__ \ + --with-lg-page-sizes=12,13,14,16 gmake dist ) } diff --git a/contrib/jemalloc/doc/jemalloc.3 b/contrib/jemalloc/doc/jemalloc.3 index 9778e5093fa2..2afb8628c65a 100644 --- a/contrib/jemalloc/doc/jemalloc.3 +++ b/contrib/jemalloc/doc/jemalloc.3 @@ -2,12 +2,12 @@ .\" Title: JEMALLOC .\" Author: Jason Evans .\" Generator: DocBook XSL Stylesheets v1.76.1 -.\" Date: 08/17/2015 +.\" Date: 08/18/2015 .\" Manual: User Manual .\" Source: jemalloc 4.0.0-0-g6e98caf8f064482b9ab292ef3638dea67420bbc2 .\" Language: English .\" -.TH "JEMALLOC" "3" "08/17/2015" "jemalloc 4.0.0-0-g6e98caf8f064" "User Manual" +.TH "JEMALLOC" "3" "08/18/2015" "jemalloc 4.0.0-0-g6e98caf8f064" "User Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -51,7 +51,8 @@ make variable)\&. .sp .ft B .nf -#include +#include +#include .fi .ft .SS "Standard API" diff --git a/include/malloc_np.h b/include/malloc_np.h index 5f9d8134791f..d3feb356b26d 100644 --- a/include/malloc_np.h +++ b/include/malloc_np.h @@ -36,13 +36,14 @@ #include __BEGIN_DECLS -typedef void *(chunk_alloc_t)(void *, size_t, size_t, bool *, bool *, unsigned); -typedef bool (chunk_dalloc_t)(void *, size_t, bool, unsigned); -typedef bool (chunk_commit_t)(void *, size_t, size_t, size_t, unsigned); -typedef bool (chunk_decommit_t)(void *, size_t, size_t, size_t, unsigned); -typedef bool (chunk_purge_t)(void *, size_t, size_t, size_t, unsigned); -typedef bool (chunk_split_t)(void *, size_t, size_t, size_t, bool, unsigned); -typedef bool (chunk_merge_t)(void *, size_t, void *, size_t, bool, unsigned); +typedef void *(chunk_alloc_t)(void *, size_t, size_t, _Bool *, _Bool *, + unsigned); +typedef _Bool (chunk_dalloc_t)(void *, size_t, _Bool, unsigned); +typedef _Bool (chunk_commit_t)(void *, size_t, size_t, size_t, unsigned); +typedef _Bool (chunk_decommit_t)(void *, size_t, size_t, size_t, unsigned); +typedef _Bool (chunk_purge_t)(void *, size_t, size_t, size_t, unsigned); +typedef _Bool (chunk_split_t)(void *, size_t, size_t, size_t, _Bool, unsigned); +typedef _Bool (chunk_merge_t)(void *, size_t, void *, size_t, _Bool, unsigned); typedef struct { chunk_alloc_t *alloc; chunk_dalloc_t *dalloc;