PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

DWORD aligned memory

Hello,

I have searched this forum and google to try and find out how memory is allocated and have done some testing.

Is it true that allocated memory is always DWORD aligned?

I have done this test, which returns true:
Code:

WORD *test[100];
bool aligned = true;

for (int j=0; j < 100; j++) {
test[j] = new WORD;
if ((int)test[j] % 4) {
aligned = false;
}
}

for (j=0; j < 100; j++) delete test[j];


A simple yes or no will suffice. :)
I think it is always true on any Win32 platform (including WinCE). But I might be wrong.