From 86243af5c612a9fbadf5dc5d90305bce1178f13c Mon Sep 17 00:00:00 2001 From: Matthew Brennan Jones Date: Wed, 30 Apr 2014 13:14:11 -0700 Subject: [PATCH] Fixed issues with using ulong instead of size_t that would break only on 32bit. --- std/allocator.d | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/std/allocator.d b/std/allocator.d index b8ae114..f9c5796 100644 --- a/std/allocator.d +++ b/std/allocator.d @@ -2860,7 +2860,7 @@ private struct BasicRegion(uint minAlign = platformAlignment) static if (minAlign > 1) { auto newStore = cast(void*) roundUpToMultipleOf( - cast(ulong) store.ptr, + cast(size_t) store.ptr, alignment); assert(newStore <= store.ptr + store.length); _current = newStore; @@ -2904,7 +2904,7 @@ private struct BasicRegion(uint minAlign = platformAlignment) // Just bump the pointer to the next good allocation auto save = _current; _current = cast(void*) roundUpToMultipleOf( - cast(ulong) _current, a); + cast(size_t) _current, a); if (auto b = allocate(bytes)) return b; // Failed, rollback _current = save; @@ -3064,7 +3064,7 @@ struct InSituRegion(size_t size, size_t minAlign = platformAlignment) { assert(!_crt); _crt = cast(void*) roundUpToMultipleOf( - cast(ulong) _store.ptr, alignment); + cast(size_t) _store.ptr, alignment); _end = _store.ptr + _store.length; } @@ -3109,7 +3109,7 @@ struct InSituRegion(size_t size, size_t minAlign = platformAlignment) // Just bump the pointer to the next good allocation auto save = _crt; _crt = cast(void*) roundUpToMultipleOf( - cast(ulong) _crt, a); + cast(size_t) _crt, a); if (auto b = allocate(bytes)) return b; // Failed, rollback _crt = save;