Fix Issue 12245 - BinaryHeap expensive in -debug

https://d.puremagic.com/issues/show_bug.cgi?id=12245
Fix issue 12183 : Use double instead of real to avoid valgrind's abort