mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-01-19 07:51:54 +00:00
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:
parent
9e715ba7cc
commit
826dfb0e5b
1 changed files with 2 additions and 2 deletions
|
@ -170,8 +170,8 @@ public:
|
|||
|
||||
private:
|
||||
typedef struct element_s {
|
||||
struct element_s * next;
|
||||
type t;
|
||||
struct element_s * next;
|
||||
} element_t;
|
||||
typedef struct block_s {
|
||||
element_t elements[blockSize];
|
||||
|
@ -217,7 +217,7 @@ type *idBlockAlloc<type,blockSize>::Alloc( void ) {
|
|||
|
||||
template<class type, int blockSize>
|
||||
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;
|
||||
free = element;
|
||||
active--;
|
||||
|
|
Loading…
Reference in a new issue