Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Hangs on some template code

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
EugeneKozlov Posted - Jan 17 2016 : 05:23:03 AM
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.
2   L A T E S T    R E P L I E S    (Newest First)
sean Posted - Feb 02 2016 : 7:46:55 PM
case=94492 is fixed in build 2089.
accord Posted - Jan 17 2016 : 06:38:41 AM
I was able to reproduce the problem, thank you for the clear description.

case=94492

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000