vendredi 8 mai 2015

Critical error detected c0000374 when allocating memory C++

When I try to allocate memory below:

float* vert = new float[24];

for ( int index = 0, subIndex = 0 ; index < 5; index++ )
{
    vert[(subIndex++) % 3] = vertexRegAOS[index].m128_f32[(subIndex++) % 3];
    vert[(subIndex++) % 3] = vertexRegAOS[index].m128_f32[(subIndex++) % 3];
    vert[(subIndex++) % 3] = vertexRegAOS[index].m128_f32[(subIndex++) % 3];
    vert[(subIndex++) % 3] = vertexRegAOS[index].m128_f32[(subIndex++) % 3];
}

I get a 'Critical error detected c0000374' and a breakpoint is triggered. VS sends me here in malloc.c :

__forceinline void * __cdecl _heap_alloc (size_t size)
{

    if (_crtheap == 0) {
        _FF_MSGBANNER();    /* write run-time error banner */

        _NMSG_WRITE(_RT_CRT_NOTINIT);  /* write message */
        __crtExitProcess(255);  /* normally _exit(255) */
    }

    return HeapAlloc(_crtheap, 0, size ? size : 1);
}

Any suggestions on this? :)

Aucun commentaire:

Enregistrer un commentaire