aboutsummaryrefslogtreecommitdiff
path: root/gnu/tests/data
diff options
context:
space:
mode:
authorNicolas Graves <ngraves@ngraves.fr>2024-05-10 00:54:24 +0200
committerSharlatan Hellseher <sharlatanus@gmail.com>2024-12-13 20:18:58 +0000
commitd41e9ce19478143883c2c81d9d1bbac6d4e6760a (patch)
tree9d4cc71e5380d455c0f66dc4d34c04fbe382cfc7 /gnu/tests/data
parent035a359e80da191d231de18bd6349311a4481c9c (diff)
downloadguix-d41e9ce19478143883c2c81d9d1bbac6d4e6760a.tar.gz
guix-d41e9ce19478143883c2c81d9d1bbac6d4e6760a.zip
gnu: python-qemu-qmp: Move to pyproject-build-system.
* gnu/packages/virtualization.scm (python-qemu-qmp): [build-system]: Move to pyproject-build-system. Change-Id: I4a11e7c913092a4798b46347388a0f07bbb85213 Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Diffstat (limited to 'gnu/tests/data')
0 files changed, 0 insertions, 0 deletions
patch makes ghc try MADV_FREE. If it doesn't work, it falls back to MADV_DONTNEED. The end result is that ghc programs free their memory with Linux < 4.5 again. See https://git.haskell.org/ghc.git/commitdiff/6576bf83cdf4eac05eb88a24aa934a736c91e3da for more information. --- a/rts/posix/OSMem.c +++ b/rts/posix/OSMem.c @@ -541,11 +541,24 @@ void osDecommitMemory(void *at, W_ size) #ifdef MADV_FREE // Try MADV_FREE first, FreeBSD has both and MADV_DONTNEED - // just swaps memory out + // just swaps memory out. Linux >= 4.5 has both DONTNEED and FREE; either + // will work as they both allow the system to free anonymous pages. + // It is important that we try both methods as the kernel which we were + // built on may differ from the kernel we are now running on. r = madvise(at, size, MADV_FREE); -#else - r = madvise(at, size, MADV_DONTNEED); + if(r < 0) { + if (errno == EINVAL) { + // Perhaps the system doesn't support MADV_FREE; fall-through and + // try MADV_DONTNEED. + } else { + sysErrorBelch("unable to decommit memory"); + } + } else { + return; + } #endif + + r = madvise(at, size, MADV_DONTNEED); if(r < 0) sysErrorBelch("unable to decommit memory"); }