[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 12 commits: rts: Consistently use stgMallocBytes instead of malloc
Marge Bot
gitlab at gitlab.haskell.org
Mon Sep 7 08:33:57 UTC 2020
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
7980ae23 by GHC GitLab CI at 2020-09-05T14:50:52-04:00
rts: Consistently use stgMallocBytes instead of malloc
This can help in debugging RTS memory leaks since all allocations go
through the same interface.
- - - - -
67059893 by Ben Gamari at 2020-09-05T14:51:27-04:00
configure: Fix whitespace
- - - - -
be2cc0ad by Ben Gamari at 2020-09-05T14:51:27-04:00
gitlab-ci: More intelligent detection of locale availability
Previously ci.sh would unconditionally use C.UTF-8. However, this fails
on Centos 7, which appears not to provide this locale. Now we first try
C.UTF-8, then try en_US.UTF-8, then fail.
Works around #18607.
- - - - -
15dca847 by Ben Gamari at 2020-09-05T14:51:27-04:00
gitlab-ci: Rename RELEASE variable to RELEASE_JOB
This interfered with the autoconf variable of the same name, breaking
pre-release builds.
- - - - -
bec0d170 by Ben Gamari at 2020-09-05T14:51:27-04:00
gitlab-ci: Bump Windows toolchain version
This should have been done when we bumped the bootstrap compiler to
8.8.4.
- - - - -
9fbaee21 by Ben Gamari at 2020-09-05T14:51:27-04:00
gitlab-ci: Drop Windows make job
These are a significant burden on our CI resources and end up failing
quite often due to #18274. Here I drop the make jobs during
validaion; it is now run only during the nightly builds.
- - - - -
869f6e19 by Ben Gamari at 2020-09-05T14:51:27-04:00
testsuite: Drop Windows-specific output for parseTree
The normalise_slashes normaliser should handle this.
- - - - -
2c9f743c by Ben Gamari at 2020-09-05T14:51:28-04:00
testsuite: Mark T5975[ab] as broken on Windows
Due to #7305.
- - - - -
643785e3 by Ben Gamari at 2020-09-05T14:51:28-04:00
gitlab-ci: Fix typo
A small typo in a rule regular expression.
- - - - -
487a8fb6 by Wander Hillen at 2020-09-07T04:33:46-04:00
Add clarification regarding poll/kqueue flags
- - - - -
f7bc4430 by Ben Gamari at 2020-09-07T04:33:46-04:00
gitlab-ci: Configure bignum backend in Hadrian builds
- - - - -
43d84527 by Ben Gamari at 2020-09-07T04:33:46-04:00
gitlab-ci: Use hadrian builds for Windows release artifacts
- - - - -
11 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- aclocal.m4
- libraries/base/configure.ac
- rts/linker/PEi386.c
- rts/win32/IOManager.c
- rts/win32/OSThreads.c
- rts/win32/WorkQueue.c
- rts/xxhash.c
- − testsuite/tests/ghc-api/annotations/parseTree.stdout-mingw32
- testsuite/tests/ghci/scripts/all.T
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -6,7 +6,7 @@ variables:
# Sequential version number capturing the versions of all tools fetched by
# .gitlab/ci.sh.
- WINDOWS_TOOLCHAIN_VERSION: 1
+ WINDOWS_TOOLCHAIN_VERSION: 2
# Disable shallow clones; they break our linting rules
GIT_DEPTH: 0
@@ -49,7 +49,7 @@ workflow:
- if: $CI_COMMIT_TAG
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == "wip/marge_bot_batch_merge_job"'
- - if: '$CI_COMMIT_BRANCH =~ /ghc-[0.9]+\.[0-9]+/'
+ - if: '$CI_COMMIT_BRANCH =~ /ghc-[0-9]+\.[0-9]+/'
- if: '$CI_PIPELINE_SOURCE == "web"'
.nightly: &nightly
@@ -67,7 +67,7 @@ workflow:
when: always
expire_in: 1 year
rules:
- - if: '$RELEASE == "yes"'
+ - if: '$RELEASE_JOB == "yes"'
############################################################
# Runner Tags
@@ -856,13 +856,16 @@ validate-x86_64-linux-fedora27:
- ghc.tar.xz
- junit.xml
-validate-x86_64-windows-hadrian:
+.build-x86_64-windows-hadrian:
extends: .build-windows-hadrian
variables:
MSYSTEM: MINGW64
- TEST_ENV: "x86_64-windows-hadrian"
+ TEST_ENV: "x86_64-windows"
cache:
- key: "x86_64-windows-hadrian-$WINDOWS_TOOLCHAIN_VERSION"
+ key: "x86_64-windows-$WINDOWS_TOOLCHAIN_VERSION"
+
+validate-x86_64-windows-hadrian:
+ extends: .build-x86_64-windows-hadrian
.build-windows-make:
extends: .build-windows
@@ -896,9 +899,6 @@ validate-x86_64-windows-hadrian:
cache:
key: "x86_64-windows-$WINDOWS_TOOLCHAIN_VERSION"
-validate-x86_64-windows:
- extends: .build-x86_64-windows-make
-
nightly-x86_64-windows:
<<: *nightly
extends: .build-x86_64-windows-make
@@ -906,16 +906,17 @@ nightly-x86_64-windows:
variables:
BUILD_FLAVOUR: "validate"
-# Normal Windows validate builds are profiled; that won't do for releases.
+# Normal Windows validate builds lack profiled libraries; that won't do for
+# releases.
release-x86_64-windows:
<<: *release
- extends: validate-x86_64-windows
+ extends: .build-x86_64-windows-hadrian
variables:
BUILD_FLAVOUR: "perf"
- #
+
release-x86_64-windows-integer-simple:
<<: *release
- extends: validate-x86_64-windows
+ extends: .build-x86_64-windows-hadrian
variables:
BIGNUM_BACKEND: native
BUILD_FLAVOUR: "perf"
@@ -970,7 +971,7 @@ doc-tarball:
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
dependencies:
- validate-x86_64-linux-deb9-debug
- - validate-x86_64-windows
+ - validate-x86_64-windows-hadrian
variables:
LINUX_BINDIST: "ghc-x86_64-deb9-linux-debug.tar.xz"
WINDOWS_BINDIST: "ghc-x86_64-mingw32.tar.xz"
=====================================
.gitlab/ci.sh
=====================================
@@ -26,9 +26,6 @@ LT_CYAN="1;36"
WHITE="1;37"
LT_GRAY="0;37"
-export LANG=C.UTF-8
-export LC_ALL=C.UTF-8
-
# GitLab Pipelines log section delimiters
# https://gitlab.com/gitlab-org/gitlab-foss/issues/14664
start_section() {
@@ -60,6 +57,30 @@ function run() {
TOP="$(pwd)"
+function setup_locale() {
+ # BSD grep terminates early with -q, consequently locale -a will get a
+ # SIGPIPE and the pipeline will fail with pipefail.
+ shopt -o -u pipefail
+ if locale -a | grep -q C.UTF-8; then
+ # Debian
+ export LANG=C.UTF-8
+ elif locale -a | grep -q C.utf8; then
+ # Fedora calls it this
+ export LANG=C.utf8
+ elif locale -a | grep -q en_US.UTF-8; then
+ # Centos doesn't have C.UTF-8
+ export LANG=en_US.UTF-8
+ else
+ error "Failed to find usable locale"
+ info "Available locales:"
+ locale -a
+ fail "No usable locale, aborting..."
+ fi
+ info "Using locale $LANG..."
+ export LC_ALL=$LANG
+ shopt -o -s pipefail
+}
+
function mingw_init() {
case "$MSYSTEM" in
MINGW32)
@@ -406,10 +427,12 @@ function clean() {
}
function run_hadrian() {
+ if [ -z "$BIGNUM_BACKEND" ]; then BIGNUM_BACKEND="gmp"; fi
run hadrian/build-cabal \
--flavour="$FLAVOUR" \
-j"$cores" \
--broken-test="$BROKEN_TESTS" \
+ --bignum=$BIGNUM_BACKEND \
$HADRIAN_ARGS \
$@
}
@@ -423,6 +446,8 @@ function shell() {
run $cmd
}
+setup_locale
+
# Determine Cabal data directory
case "$(uname)" in
MSYS_*|MINGW*) exe=".exe"; cabal_dir="$APPDATA/cabal" ;;
=====================================
aclocal.m4
=====================================
@@ -1627,37 +1627,37 @@ AC_SUBST([GccExtraViaCOpts],$fp_cv_gcc_extra_opts)
# ---------------------
AC_DEFUN([FP_SETUP_PROJECT_VERSION],
[
-if test "$RELEASE" = "NO"; then
- AC_MSG_CHECKING([for GHC version date])
- if test -f VERSION_DATE; then
- PACKAGE_VERSION=${PACKAGE_VERSION}.`cat VERSION_DATE`
- AC_MSG_RESULT(given $PACKAGE_VERSION)
- elif test -e .git; then
- changequote(, )dnl
- ver_posixtime=`git log -1 --pretty=format:%ct`
- ver_date=`perl -MPOSIX -e "print strftime('%Y%m%d', gmtime($ver_posixtime));"`
- if echo $ver_date | grep '^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$' 2>&1 >/dev/null; then true; else
- changequote([, ])dnl
- AC_MSG_ERROR([failed to detect version date: check that git and perl are in your path])
+ if test "$RELEASE" = "NO"; then
+ AC_MSG_CHECKING([for GHC version date])
+ if test -f VERSION_DATE; then
+ PACKAGE_VERSION=${PACKAGE_VERSION}.`cat VERSION_DATE`
+ AC_MSG_RESULT(given $PACKAGE_VERSION)
+ elif test -e .git; then
+ changequote(, )dnl
+ ver_posixtime=`git log -1 --pretty=format:%ct`
+ ver_date=`perl -MPOSIX -e "print strftime('%Y%m%d', gmtime($ver_posixtime));"`
+ if echo $ver_date | grep '^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$' 2>&1 >/dev/null; then true; else
+ changequote([, ])dnl
+ AC_MSG_ERROR([failed to detect version date: check that git and perl are in your path])
+ fi
+ PACKAGE_VERSION=${PACKAGE_VERSION}.$ver_date
+ AC_MSG_RESULT(inferred $PACKAGE_VERSION)
+ elif test -f VERSION; then
+ PACKAGE_VERSION=`cat VERSION`
+ AC_MSG_RESULT(given $PACKAGE_VERSION)
+ else
+ AC_MSG_WARN([cannot determine snapshot version: no .git directory and no VERSION file])
+ dnl We'd really rather this case didn't happen, but it might
+ dnl do (in particular, people using lndir trees may find that
+ dnl the build system can't find any other date). If it does
+ dnl happen, then we use the current date.
+ dnl This way we get some idea about how recent a build is.
+ dnl It also means that packages built for 2 different builds
+ dnl will probably use different version numbers, so things are
+ dnl less likely to go wrong.
+ PACKAGE_VERSION=${PACKAGE_VERSION}.`date +%Y%m%d`
fi
- PACKAGE_VERSION=${PACKAGE_VERSION}.$ver_date
- AC_MSG_RESULT(inferred $PACKAGE_VERSION)
- elif test -f VERSION; then
- PACKAGE_VERSION=`cat VERSION`
- AC_MSG_RESULT(given $PACKAGE_VERSION)
- else
- AC_MSG_WARN([cannot determine snapshot version: no .git directory and no VERSION file])
- dnl We'd really rather this case didn't happen, but it might
- dnl do (in particular, people using lndir trees may find that
- dnl the build system can't find any other date). If it does
- dnl happen, then we use the current date.
- dnl This way we get some idea about how recent a build is.
- dnl It also means that packages built for 2 different builds
- dnl will probably use different version numbers, so things are
- dnl less likely to go wrong.
- PACKAGE_VERSION=${PACKAGE_VERSION}.`date +%Y%m%d`
fi
-fi
AC_MSG_CHECKING([for GHC Git commit id])
if test -e .git; then
@@ -1676,54 +1676,54 @@ fi
fi
-# Some renamings
-AC_SUBST([ProjectName], [$PACKAGE_NAME])
-AC_SUBST([ProjectVersion], [$PACKAGE_VERSION])
-AC_SUBST([ProjectGitCommitId], [$PACKAGE_GIT_COMMIT_ID])
+ # Some renamings
+ AC_SUBST([ProjectName], [$PACKAGE_NAME])
+ AC_SUBST([ProjectVersion], [$PACKAGE_VERSION])
+ AC_SUBST([ProjectGitCommitId], [$PACKAGE_GIT_COMMIT_ID])
-# Split PACKAGE_VERSION into (possibly empty) parts
-VERSION_MAJOR=`echo $PACKAGE_VERSION | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\1'/`
-VERSION_TMP=`echo $PACKAGE_VERSION | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\3'/`
-VERSION_MINOR=`echo $VERSION_TMP | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\1'/`
-ProjectPatchLevel=`echo $VERSION_TMP | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\3'/`
+ # Split PACKAGE_VERSION into (possibly empty) parts
+ VERSION_MAJOR=`echo $PACKAGE_VERSION | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\1'/`
+ VERSION_TMP=`echo $PACKAGE_VERSION | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\3'/`
+ VERSION_MINOR=`echo $VERSION_TMP | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\1'/`
+ ProjectPatchLevel=`echo $VERSION_TMP | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\3'/`
-# Calculate project version as an integer, using 2 digits for minor version
-case $VERSION_MINOR in
- ?) ProjectVersionInt=${VERSION_MAJOR}0${VERSION_MINOR} ;;
- ??) ProjectVersionInt=${VERSION_MAJOR}${VERSION_MINOR} ;;
- *) AC_MSG_ERROR([bad minor version in $PACKAGE_VERSION]) ;;
-esac
-AC_SUBST([ProjectVersionInt])
+ # Calculate project version as an integer, using 2 digits for minor version
+ case $VERSION_MINOR in
+ ?) ProjectVersionInt=${VERSION_MAJOR}0${VERSION_MINOR} ;;
+ ??) ProjectVersionInt=${VERSION_MAJOR}${VERSION_MINOR} ;;
+ *) AC_MSG_ERROR([bad minor version in $PACKAGE_VERSION]) ;;
+ esac
+ AC_SUBST([ProjectVersionInt])
-# The project patchlevel is zero unless stated otherwise
-test -z "$ProjectPatchLevel" && ProjectPatchLevel=0
+ # The project patchlevel is zero unless stated otherwise
+ test -z "$ProjectPatchLevel" && ProjectPatchLevel=0
-# Save split version of ProjectPatchLevel
-ProjectPatchLevel1=`echo $ProjectPatchLevel | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\1/'`
-ProjectPatchLevel2=`echo $ProjectPatchLevel | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\3/'`
+ # Save split version of ProjectPatchLevel
+ ProjectPatchLevel1=`echo $ProjectPatchLevel | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\1/'`
+ ProjectPatchLevel2=`echo $ProjectPatchLevel | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\3/'`
-AC_SUBST([ProjectPatchLevel1])
-AC_SUBST([ProjectPatchLevel2])
+ AC_SUBST([ProjectPatchLevel1])
+ AC_SUBST([ProjectPatchLevel2])
-# Remove dots from the patch level; this allows us to have versions like 6.4.1.20050508
-ProjectPatchLevel=`echo $ProjectPatchLevel | sed 's/\.//'`
+ # Remove dots from the patch level; this allows us to have versions like 6.4.1.20050508
+ ProjectPatchLevel=`echo $ProjectPatchLevel | sed 's/\.//'`
-AC_SUBST([ProjectPatchLevel])
+ AC_SUBST([ProjectPatchLevel])
-# The version of the GHC package changes every day, since the
-# patchlevel is the current date. We don't want to force
-# recompilation of the entire compiler when this happens, so for
-# GHC HEAD we omit the patchlevel from the package version number.
-#
-# The ProjectPatchLevel1 > 20000000 iff GHC HEAD. If it's for a stable
-# release like 7.10.1 or for a release candidate such as 7.10.1.20141224
-# then we don't omit the patchlevel components.
+ # The version of the GHC package changes every day, since the
+ # patchlevel is the current date. We don't want to force
+ # recompilation of the entire compiler when this happens, so for
+ # GHC HEAD we omit the patchlevel from the package version number.
+ #
+ # The ProjectPatchLevel1 > 20000000 iff GHC HEAD. If it's for a stable
+ # release like 7.10.1 or for a release candidate such as 7.10.1.20141224
+ # then we don't omit the patchlevel components.
-ProjectVersionMunged="$ProjectVersion"
-if test "$ProjectPatchLevel1" -gt 20000000; then
- ProjectVersionMunged="${VERSION_MAJOR}.${VERSION_MINOR}"
-fi
-AC_SUBST([ProjectVersionMunged])
+ ProjectVersionMunged="$ProjectVersion"
+ if test "$ProjectPatchLevel1" -gt 20000000; then
+ ProjectVersionMunged="${VERSION_MAJOR}.${VERSION_MINOR}"
+ fi
+ AC_SUBST([ProjectVersionMunged])
])# FP_SETUP_PROJECT_VERSION
# Check for a working timer_create(). We need a pretty detailed check
=====================================
libraries/base/configure.ac
=====================================
@@ -47,9 +47,13 @@ AC_CHECK_FUNCS([clock_gettime])
AC_CHECK_FUNCS([getclock getrusage times])
AC_CHECK_FUNCS([_chsize ftruncate])
-AC_CHECK_FUNCS([epoll_ctl eventfd kevent kevent64 kqueue poll])
-
# event-related fun
+# The line below already defines HAVE_KQUEUE and HAVE_POLL, so technically some of the
+# subsequent portions that redefine them could be skipped. However, we keep those portions
+# to keep kqueue/poll in line with HAVE_EPOLL and possible other additions in the future. You
+# should be aware of this peculiarity if you try to simulate not having kqueue or poll by
+# moving away header files (see also https://gitlab.haskell.org/ghc/ghc/-/issues/9283)
+AC_CHECK_FUNCS([epoll_ctl eventfd kevent kevent64 kqueue poll])
if test "$ac_cv_header_sys_epoll_h" = yes && test "$ac_cv_func_epoll_ctl" = yes; then
AC_DEFINE([HAVE_EPOLL], [1], [Define if you have epoll support.])
=====================================
rts/linker/PEi386.c
=====================================
@@ -735,7 +735,7 @@ addDLL_PEi386( pathchar *dll_name, HINSTANCE *loaded )
error:
stgFree(buf);
- char* errormsg = malloc(sizeof(char) * 80);
+ char* errormsg = stgMallocBytes(sizeof(char) * 80, "addDLL_PEi386");
snprintf(errormsg, 80, "addDLL: %" PATH_FMT " or dependencies not loaded. (Win32 error %lu)", dll_name, GetLastError());
/* LoadLibrary failed; return a ptr to the error msg. */
return errormsg;
@@ -745,7 +745,7 @@ pathchar* findSystemLibrary_PEi386( pathchar* dll_name )
{
const unsigned int init_buf_size = 1024;
unsigned int bufsize = init_buf_size;
- wchar_t* result = malloc(sizeof(wchar_t) * bufsize);
+ wchar_t* result = stgMallocBytes(sizeof(wchar_t) * bufsize, "findSystemLibrary_PEi386");
DWORD wResult = SearchPathW(NULL, dll_name, NULL, bufsize, result, NULL);
if (wResult > bufsize) {
@@ -755,7 +755,7 @@ pathchar* findSystemLibrary_PEi386( pathchar* dll_name )
if (!wResult) {
- free(result);
+ stgFree(result);
return NULL;
}
@@ -773,7 +773,7 @@ HsPtr addLibrarySearchPath_PEi386(pathchar* dll_path)
int bufsize = init_buf_size;
// Make sure the path is an absolute path
- WCHAR* abs_path = malloc(sizeof(WCHAR) * init_buf_size);
+ WCHAR* abs_path = stgMallocBytes(sizeof(WCHAR) * init_buf_size, "addLibrarySearchPath_PEi386(1)");
DWORD wResult = GetFullPathNameW(dll_path, bufsize, abs_path, NULL);
if (!wResult){
IF_DEBUG(linker, debugBelch("addLibrarySearchPath[GetFullPathNameW]: %" PATH_FMT " (Win32 error %lu)", dll_path, GetLastError()));
@@ -791,7 +791,7 @@ HsPtr addLibrarySearchPath_PEi386(pathchar* dll_path)
else
{
warnMissingKBLibraryPaths();
- WCHAR* str = malloc(sizeof(WCHAR) * init_buf_size);
+ WCHAR* str = stgMallocBytes(sizeof(WCHAR) * init_buf_size, "addLibrarySearchPath_PEi386(2)");
wResult = GetEnvironmentVariableW(L"PATH", str, bufsize);
if (wResult > init_buf_size) {
@@ -804,7 +804,7 @@ HsPtr addLibrarySearchPath_PEi386(pathchar* dll_path)
}
bufsize = wResult + 2 + pathlen(abs_path);
- wchar_t* newPath = malloc(sizeof(wchar_t) * bufsize);
+ wchar_t* newPath = stgMallocBytes(sizeof(wchar_t) * bufsize, "addLibrarySearchPath_PEi386(3)");
wcscpy(newPath, abs_path);
wcscat(newPath, L";");
@@ -813,19 +813,19 @@ HsPtr addLibrarySearchPath_PEi386(pathchar* dll_path)
sysErrorBelch("addLibrarySearchPath[SetEnvironmentVariableW]: %" PATH_FMT " (Win32 error %lu)", abs_path, GetLastError());
}
- free(newPath);
- free(abs_path);
+ stgFree(newPath);
+ stgFree(abs_path);
return str;
}
if (!result) {
sysErrorBelch("addLibrarySearchPath: %" PATH_FMT " (Win32 error %lu)", abs_path, GetLastError());
- free(abs_path);
+ stgFree(abs_path);
return NULL;
}
- free(abs_path);
+ stgFree(abs_path);
return result;
}
=====================================
rts/win32/IOManager.c
=====================================
@@ -265,7 +265,7 @@ IOWorkerProc(PVOID param)
}
// Free the WorkItem
DeregisterWorkItem(iom,work);
- free(work);
+ stgFree(work);
} else {
fprintf(stderr, "unable to fetch work; fatal.\n");
fflush(stderr);
@@ -321,7 +321,7 @@ StartIOManager(void)
wq = NewWorkQueue();
if ( !wq ) return false;
- ioMan = (IOManagerState*)malloc(sizeof(IOManagerState));
+ ioMan = (IOManagerState*)stgMallocBytes(sizeof(IOManagerState), "StartIOManager");
if (!ioMan) {
FreeWorkQueue(wq);
@@ -332,7 +332,7 @@ StartIOManager(void)
hExit = CreateEvent ( NULL, true, false, NULL );
if ( !hExit ) {
FreeWorkQueue(wq);
- free(ioMan);
+ stgFree(ioMan);
return false;
}
@@ -440,8 +440,7 @@ AddIORequest ( int fd,
{
ASSERT(ioMan);
- WorkItem* wItem = (WorkItem*)malloc(sizeof(WorkItem));
- if (!wItem) return 0;
+ WorkItem* wItem = (WorkItem*)stgMallocBytse(sizeof(WorkItem), "AddIORequest");
unsigned int reqID = ioMan->requestID++;
@@ -471,8 +470,7 @@ AddDelayRequest ( HsInt usecs,
{
ASSERT(ioMan);
- WorkItem* wItem = (WorkItem*)malloc(sizeof(WorkItem));
- if (!wItem) return false;
+ WorkItem* wItem = (WorkItem*)stgMallocBytes(sizeof(WorkItem), "AddDelayRequest");
unsigned int reqID = ioMan->requestID++;
@@ -498,7 +496,7 @@ AddProcRequest ( void* proc,
{
ASSERT(ioMan);
- WorkItem* wItem = (WorkItem*)malloc(sizeof(WorkItem));
+ WorkItem* wItem = (WorkItem*)stgMallocBytes(sizeof(WorkItem), "AddProcRequest");
if (!wItem) return false;
unsigned int reqID = ioMan->requestID++;
@@ -542,7 +540,7 @@ void ShutdownIOManager ( bool wait_threads )
barf("timeEndPeriod failed");
}
- free(ioMan);
+ stgFree(ioMan);
ioMan = NULL;
}
}
=====================================
rts/win32/OSThreads.c
=====================================
@@ -171,19 +171,19 @@ void freeThreadingResources (void)
{
if (cpuGroupCache)
{
- free(cpuGroupCache);
+ stgFree(cpuGroupCache);
cpuGroupCache = NULL;
}
if (cpuGroupCumulativeCache)
{
- free(cpuGroupCumulativeCache);
+ stgFree(cpuGroupCumulativeCache);
cpuGroupCumulativeCache = NULL;
}
if (cpuGroupDistCache)
{
- free(cpuGroupDistCache);
+ stgFree(cpuGroupDistCache);
cpuGroupDistCache = NULL;
}
}
@@ -240,7 +240,7 @@ getProcessorsDistribution (void)
if (!cpuGroupDistCache)
{
uint8_t n_groups = getNumberOfProcessorsGroups();
- cpuGroupDistCache = malloc(n_groups * sizeof(uint8_t));
+ cpuGroupDistCache = stgMallocBytes(n_groups * sizeof(uint8_t), "getProcessorsDistribution");
memset(cpuGroupDistCache, MAXIMUM_PROCESSORS, n_groups * sizeof(uint8_t));
for (int i = 0; i < n_groups; i++)
@@ -265,7 +265,7 @@ getProcessorsCumulativeSum(void)
if (!cpuGroupCumulativeCache)
{
uint8_t n_groups = getNumberOfProcessorsGroups();
- cpuGroupCumulativeCache = malloc(n_groups * sizeof(uint32_t));
+ cpuGroupCumulativeCache = stgMallocBytes(n_groups * sizeof(uint32_t), "getProcessorsCumulativeSum");
memset(cpuGroupCumulativeCache, 0, n_groups * sizeof(uint32_t));
#if defined(x86_64_HOST_ARCH)
@@ -306,7 +306,7 @@ createProcessorGroupMap (void)
uint32_t numProcs = getNumberOfProcessors();
- cpuGroupCache = malloc(numProcs * sizeof(uint8_t));
+ cpuGroupCache = stgMallocBytes(numProcs * sizeof(uint8_t), "createProcessorGroupMap");
/* For 32bit Windows and 64bit older than Windows 7, create a default mapping. */
memset(cpuGroupCache, 0, numProcs * sizeof(uint8_t));
@@ -386,7 +386,7 @@ setThreadAffinity (uint32_t n, uint32_t m) // cap N of M
ASSERT(n_groups > 0);
ASSERT(n_proc > 0);
- mask = malloc(n_groups * sizeof(DWORD_PTR));
+ mask = stgMallocBytes(n_groups * sizeof(DWORD_PTR), "setThreadAffinity");
memset(mask, 0, n_groups * sizeof(DWORD_PTR));
/* The mask for the individual groups are all 0 based
@@ -422,14 +422,14 @@ setThreadAffinity (uint32_t n, uint32_t m) // cap N of M
{
r = SetThreadAffinityMask(hThread, mask[i]);
if (r == 0) {
- free(mask);
+ stgFree(mask);
sysErrorBelch("SetThreadAffinity");
stg_exit(EXIT_FAILURE);
}
}
}
- free(mask);
+ stgFree(mask);
}
void
=====================================
rts/win32/WorkQueue.c
=====================================
@@ -41,12 +41,7 @@ newSemaphore(int initCount, int max)
WorkQueue*
NewWorkQueue()
{
- WorkQueue* wq = (WorkQueue*)malloc(sizeof(WorkQueue));
-
- if (!wq) {
- queue_error("NewWorkQueue", "malloc() failed");
- return wq;
- }
+ WorkQueue* wq = (WorkQueue*)stgMallocBytes(sizeof(WorkQueue), "NewWorkQueue");
memset(wq, 0, sizeof *wq);
=====================================
rts/xxhash.c
=====================================
@@ -98,9 +98,11 @@
***************************************/
/*! Modify the local functions below should you wish to use some other memory routines
* for malloc(), free() */
-#include <stdlib.h>
-static void* XXH_malloc(size_t s) { return malloc(s); }
-static void XXH_free (void* p) { free(p); }
+#include "Rts.h"
+#include "RtsUtils.h"
+
+static void* XXH_malloc(size_t s) { return stgMallocBytes(s, "XXH_malloc"); }
+static void XXH_free (void* p) { stgFree(p); }
/*! and for memcpy() */
#include <string.h>
static void* XXH_memcpy(void* dest, const void* src, size_t size) { return memcpy(dest,src,size); }
=====================================
testsuite/tests/ghc-api/annotations/parseTree.stdout-mingw32 deleted
=====================================
@@ -1,160 +0,0 @@
-[(AnnotationTuple.hs:14:20, [p], Solo 1),
- (AnnotationTuple.hs:14:23-29, [p], Solo "hello"),
- (AnnotationTuple.hs:14:35-37, [p], Solo 6.5),
- (AnnotationTuple.hs:14:39, [m], ()),
- (AnnotationTuple.hs:14:41-52, [p], Solo [5, 5, 6, 7]),
- (AnnotationTuple.hs:16:8, [p], Solo 1),
- (AnnotationTuple.hs:16:11-17, [p], Solo "hello"),
- (AnnotationTuple.hs:16:20-22, [p], Solo 6.5),
- (AnnotationTuple.hs:16:24, [m], ()),
- (AnnotationTuple.hs:16:25, [m], ()),
- (AnnotationTuple.hs:16:26, [m], ()), (<no location info>, [m], ())]
-[
-(AK AnnotationTuple.hs:1:1 AnnCloseC = [AnnotationTuple.hs:27:1])
-
-(AK AnnotationTuple.hs:1:1 AnnModule = [AnnotationTuple.hs:3:1-6])
-
-(AK AnnotationTuple.hs:1:1 AnnOpenC = [AnnotationTuple.hs:5:1])
-
-(AK AnnotationTuple.hs:1:1 AnnWhere = [AnnotationTuple.hs:3:30-34])
-
-(AK AnnotationTuple.hs:3:24-28 AnnCloseP = [AnnotationTuple.hs:3:28])
-
-(AK AnnotationTuple.hs:3:24-28 AnnOpenP = [AnnotationTuple.hs:3:24])
-
-(AK AnnotationTuple.hs:6:1-32 AnnAs = [AnnotationTuple.hs:6:28-29])
-
-(AK AnnotationTuple.hs:6:1-32 AnnImport = [AnnotationTuple.hs:6:1-6])
-
-(AK AnnotationTuple.hs:6:1-32 AnnQualified = [AnnotationTuple.hs:6:8-16])
-
-(AK AnnotationTuple.hs:6:1-32 AnnSemi = [AnnotationTuple.hs:7:1])
-
-(AK AnnotationTuple.hs:(8,1)-(11,14) AnnEqual = [AnnotationTuple.hs:8:5])
-
-(AK AnnotationTuple.hs:(8,1)-(11,14) AnnFunId = [AnnotationTuple.hs:8:1-3])
-
-(AK AnnotationTuple.hs:(8,1)-(11,14) AnnSemi = [AnnotationTuple.hs:13:1])
-
-(AK AnnotationTuple.hs:(8,7)-(11,14) AnnIn = [AnnotationTuple.hs:11:7-8])
-
-(AK AnnotationTuple.hs:(8,7)-(11,14) AnnLet = [AnnotationTuple.hs:8:7-9])
-
-(AK AnnotationTuple.hs:9:9-13 AnnEqual = [AnnotationTuple.hs:9:11])
-
-(AK AnnotationTuple.hs:9:9-13 AnnFunId = [AnnotationTuple.hs:9:9])
-
-(AK AnnotationTuple.hs:9:9-13 AnnSemi = [AnnotationTuple.hs:10:9])
-
-(AK AnnotationTuple.hs:10:9-13 AnnEqual = [AnnotationTuple.hs:10:11])
-
-(AK AnnotationTuple.hs:10:9-13 AnnFunId = [AnnotationTuple.hs:10:9])
-
-(AK AnnotationTuple.hs:11:10-14 AnnVal = [AnnotationTuple.hs:11:12])
-
-(AK AnnotationTuple.hs:14:1-72 AnnEqual = [AnnotationTuple.hs:14:5])
-
-(AK AnnotationTuple.hs:14:1-72 AnnFunId = [AnnotationTuple.hs:14:1-3])
-
-(AK AnnotationTuple.hs:14:1-72 AnnSemi = [AnnotationTuple.hs:15:1])
-
-(AK AnnotationTuple.hs:14:7-72 AnnVal = [AnnotationTuple.hs:14:13])
-
-(AK AnnotationTuple.hs:14:19-53 AnnCloseP = [AnnotationTuple.hs:14:53])
-
-(AK AnnotationTuple.hs:14:19-53 AnnOpenP = [AnnotationTuple.hs:14:19])
-
-(AK AnnotationTuple.hs:14:20 AnnComma = [AnnotationTuple.hs:14:21])
-
-(AK AnnotationTuple.hs:14:23-29 AnnComma = [AnnotationTuple.hs:14:33])
-
-(AK AnnotationTuple.hs:14:35-37 AnnComma = [AnnotationTuple.hs:14:38])
-
-(AK AnnotationTuple.hs:14:39 AnnComma = [AnnotationTuple.hs:14:39])
-
-(AK AnnotationTuple.hs:14:41-52 AnnCloseS = [AnnotationTuple.hs:14:52])
-
-(AK AnnotationTuple.hs:14:41-52 AnnOpenS = [AnnotationTuple.hs:14:41])
-
-(AK AnnotationTuple.hs:14:42 AnnComma = [AnnotationTuple.hs:14:43])
-
-(AK AnnotationTuple.hs:14:45 AnnComma = [AnnotationTuple.hs:14:46])
-
-(AK AnnotationTuple.hs:14:48 AnnComma = [AnnotationTuple.hs:14:49])
-
-(AK AnnotationTuple.hs:14:55-72 AnnCloseS = [AnnotationTuple.hs:14:72])
-
-(AK AnnotationTuple.hs:14:55-72 AnnOpenS = [AnnotationTuple.hs:14:55])
-
-(AK AnnotationTuple.hs:14:56-62 AnnComma = [AnnotationTuple.hs:14:63])
-
-(AK AnnotationTuple.hs:14:61-62 AnnCloseP = [AnnotationTuple.hs:14:62])
-
-(AK AnnotationTuple.hs:14:61-62 AnnOpenP = [AnnotationTuple.hs:14:61])
-
-(AK AnnotationTuple.hs:16:1-41 AnnEqual = [AnnotationTuple.hs:16:5])
-
-(AK AnnotationTuple.hs:16:1-41 AnnFunId = [AnnotationTuple.hs:16:1-3])
-
-(AK AnnotationTuple.hs:16:1-41 AnnSemi = [AnnotationTuple.hs:17:1])
-
-(AK AnnotationTuple.hs:16:7-27 AnnCloseP = [AnnotationTuple.hs:16:27])
-
-(AK AnnotationTuple.hs:16:7-27 AnnOpenP = [AnnotationTuple.hs:16:7])
-
-(AK AnnotationTuple.hs:16:8 AnnComma = [AnnotationTuple.hs:16:9])
-
-(AK AnnotationTuple.hs:16:11-17 AnnComma = [AnnotationTuple.hs:16:18])
-
-(AK AnnotationTuple.hs:16:20-22 AnnComma = [AnnotationTuple.hs:16:23])
-
-(AK AnnotationTuple.hs:16:24 AnnComma = [AnnotationTuple.hs:16:24])
-
-(AK AnnotationTuple.hs:16:25 AnnComma = [AnnotationTuple.hs:16:25])
-
-(AK AnnotationTuple.hs:16:26 AnnComma = [AnnotationTuple.hs:16:26])
-
-(AK AnnotationTuple.hs:16:33-41 AnnCloseP = [AnnotationTuple.hs:16:41])
-
-(AK AnnotationTuple.hs:16:33-41 AnnOpenP = [AnnotationTuple.hs:16:33])
-
-(AK AnnotationTuple.hs:16:39-40 AnnCloseP = [AnnotationTuple.hs:16:40])
-
-(AK AnnotationTuple.hs:16:39-40 AnnOpenP = [AnnotationTuple.hs:16:39])
-
-(AK AnnotationTuple.hs:18:1-28 AnnData = [AnnotationTuple.hs:18:1-4])
-
-(AK AnnotationTuple.hs:18:1-28 AnnDcolon = [AnnotationTuple.hs:18:20-21])
-
-(AK AnnotationTuple.hs:18:1-28 AnnFamily = [AnnotationTuple.hs:18:6-11])
-
-(AK AnnotationTuple.hs:18:1-28 AnnSemi = [AnnotationTuple.hs:19:1])
-
-(AK AnnotationTuple.hs:18:23 AnnRarrow = [AnnotationTuple.hs:18:25-26])
-
-(AK AnnotationTuple.hs:18:23-28 AnnRarrow = [AnnotationTuple.hs:18:25-26])
-
-(AK AnnotationTuple.hs:(20,1)-(24,14) AnnFunId = [AnnotationTuple.hs:20:1-5])
-
-(AK AnnotationTuple.hs:(20,1)-(24,14) AnnSemi = [AnnotationTuple.hs:25:1])
-
-(AK AnnotationTuple.hs:(21,7)-(24,14) AnnEqual = [AnnotationTuple.hs:24:7])
-
-(AK AnnotationTuple.hs:(21,7)-(24,14) AnnVbar = [AnnotationTuple.hs:21:7])
-
-(AK AnnotationTuple.hs:21:9-24 AnnComma = [AnnotationTuple.hs:22:7])
-
-(AK AnnotationTuple.hs:21:9-24 AnnLarrow = [AnnotationTuple.hs:21:16-17])
-
-(AK AnnotationTuple.hs:22:9-25 AnnComma = [AnnotationTuple.hs:23:7])
-
-(AK AnnotationTuple.hs:22:9-25 AnnLarrow = [AnnotationTuple.hs:22:16-17])
-
-(AK AnnotationTuple.hs:23:9-24 AnnLarrow = [AnnotationTuple.hs:23:16-17])
-
-(AK AnnotationTuple.hs:26:1-10 AnnDcolon = [AnnotationTuple.hs:26:5-6])
-
-(AK AnnotationTuple.hs:26:1-14 AnnEqual = [AnnotationTuple.hs:26:12])
-]
-
-EOF: Just SrcSpanPoint ".\\AnnotationTuple.hs" 32 1
=====================================
testsuite/tests/ghci/scripts/all.T
=====================================
@@ -141,8 +141,11 @@ test('T5979',
normalise_slashes,
normalise_version("transformers")],
ghci_script, ['T5979.script'])
-test('T5975a', [pre_cmd('touch föøbàr1.hs')], ghci_script, ['T5975a.script'])
-test('T5975b', [pre_cmd('touch föøbàr2.hs'), extra_hc_opts('föøbàr2.hs')],
+test('T5975a',
+ [pre_cmd('touch föøbàr1.hs'), when(opsys('mingw32'), expect_broken(7305))],
+ ghci_script, ['T5975a.script'])
+test('T5975b',
+ [pre_cmd('touch föøbàr2.hs'), extra_hc_opts('föøbàr2.hs'), when(opsys('mingw32'), expect_broken(7305))],
ghci_script, ['T5975b.script'])
test('T6027ghci', normal, ghci_script, ['T6027ghci.script'])
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2c5f7a35103533495d26d80df30f91f62d6e2650...43d845277424642c447a2e4a13e7e1e1903c16a9
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2c5f7a35103533495d26d80df30f91f62d6e2650...43d845277424642c447a2e4a13e7e1e1903c16a9
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200907/3630c6e9/attachment-0001.html>
More information about the ghc-commits
mailing list