Allocation style in QXLDOD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Vadim,


Looking at the code for QxlDod.cpp, I see allocations that look like this:

5c52e50b (Vadim Rozenfeld             2014-09-02 17:36:27 +1000 3169)     m_ModeNumbers = reinterpret_cast<PUSHORT> (new (PagedPool)  BYTE [sizeof (USHORT) * ModeCount]);

and corresponding deallocations that look like this:

165b53d4 (Vadim Rozenfeld             2015-03-30 22:57:12 +1100 3154)     delete [] reinterpret_cast<BYTE*>(m_ModeInfo);
165b53d4 (Vadim Rozenfeld             2015-03-30 22:57:12 +1100 3155)     delete [] reinterpret_cast<BYTE*>(m_ModeNumbers);

I was wondering if there was a rationale behind this way of allocating things vs the more standard:

	m_ModeNumbers = new(PagedPool) USHORT[ModeCount];

and

	delete[] m_ModeNumbers;

?

Thanks
Christophe
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]