Hello,
For a long time I see one annoying bug.
Sometimes Visual Assist cause Visual Studio 2015 hang for ~5 seconds. Task Manager shows huge memory allocation (~1 GB) during that hang.
This occurs when I am editing or reading code with some template stuff.
I have extracted quite small code that cause hangs for me.
Create empty project with two files.
main.cpp
#include "Binary.h"
int main()
{
return 0;
}
Binary.h
#pragma once
#include <string>
using namespace std;
using sshort = int16_t;
using ushort = uint16_t;
using sint = int32_t;
using uint = uint32_t;
using slong = int64_t;
using ulong = uint64_t;
template <class Integer, class Type = void>
using EnableIfInteger2 = enable_if_t<is_integral<Integer>::value && (sizeof(Integer) > 1), Type>;
template <class Object>
struct Binary
{
template <class Stream>
static void read(Stream& stream, Object& object)
{
stream.read(&object, sizeof(object));
}
template <class Stream>
static void write(Stream& stream, const Object& object)
{
stream.write(&object, sizeof(object));
}
};
template <class Integer, class = EnableIfInteger2<Integer>>
struct BinaryInteger
{
template <class Stream>
static void read(Stream& stream, Integer& object)
{
stream.read(&object, sizeof(object));
object = swapBytes(object);
}
template <class Stream>
static void write(Stream& stream, const Integer& object)
{
Integer tmp = swapBytes(object);
stream.write(&tmp, sizeof(tmp));
}
};
template <>
struct Binary<ushort> : BinaryInteger<ushort> { };
template <>
struct Binary<sshort> : BinaryInteger<sshort> { };
template <>
struct Binary<uint> : BinaryInteger<uint> { };
template <>
struct Binary<sint> : BinaryInteger<sint> { };
template <>
struct Binary<ulong> : BinaryInteger<ulong> { };
template <>
struct Binary<slong> : BinaryInteger<slong> { };
Then try to edit the bottom part of Binary.h, click somewhere on names, scroll file, alt-tab Visual Studio, etc.
I have the latest release of VAX.
Thank you.