Fix alignment issue with idBlockAlloc::Free()

Bug introduced with e97d3288. This doesn't work with MinGW, since
the struct members might not be aligned to the native pointer
size (in this case idSampleDecoderLocal was aligned to a 8 byte
boundary on win32).
Just switch the two members to avoid ugly code.
This commit is contained in:
dhewg 2011-12-22 18:46:42 +01:00 committed by Daniel Gibson
parent 22637272dc
commit 01b5e365e8

View file

@ -170,8 +170,8 @@ public:
private: private:
typedef struct element_s { typedef struct element_s {
struct element_s * next;
type t; type t;
struct element_s * next;
} element_t; } element_t;
typedef struct block_s { typedef struct block_s {
element_t elements[blockSize]; element_t elements[blockSize];
@ -217,7 +217,7 @@ type *idBlockAlloc<type,blockSize>::Alloc( void ) {
template<class type, int blockSize> template<class type, int blockSize>
void idBlockAlloc<type,blockSize>::Free( type *t ) { void idBlockAlloc<type,blockSize>::Free( type *t ) {
element_t *element = (element_t *)( intptr_t(t) - sizeof(intptr_t) ); element_t *element = (element_t *)t;
element->next = free; element->next = free;
free = element; free = element;
active--; active--;