Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1991 from wilzbach/fix-17956
Browse files Browse the repository at this point in the history
Fix Issue 17956 - core.memory unittest failure (possibly glibc 2.26 s…
merged-on-behalf-of: Petar Kirov <ZombineDev@users.noreply.github.com>
  • Loading branch information
dlang-bot committed Dec 15, 2017
2 parents 7734817 + 52d7e94 commit ff04e96
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/memory.d
Expand Up @@ -891,9 +891,9 @@ void pureFree(void* ptr) @system pure @nogc nothrow

fakePureFree(y);

// subtract 2 because snn.lib adds 2 unconditionally before passing
// the size to the Windows API
void* z = pureMalloc(size_t.max - 2); // won't affect `errno`
// Workaround bug in glibc 2.26
// See also: https://issues.dlang.org/show_bug.cgi?id=17956
void* z = pureMalloc(size_t.max & ~255); // won't affect `errno`
assert(errno == fakePureErrno()); // errno shouldn't change
assert(z is null);
}
Expand Down

0 comments on commit ff04e96

Please sign in to comment.