Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Aligned malloc on cygwin (Tord)

Author: Scott Gasch

Date: 11:44:27 02/18/05

Go up one level in this thread


I don't know anything about cygwin.

But if the function eventually makes it to the NT heap (ntdll!RtlAllocateHeap)
then  the pointer you get back is at least 8 byte aligned.  The malloc function
in Microsoft's C runtime libraries and the GlobalAlloc and LocalAlloc and
HeapAlloc functions in kernel32 all eventuall call this ntdll function.

If you can call VirtualAlloc that gives you memory that is always paged aligned
but the downside is that the allocation granularity is one page of memory so
this only makes sense for very large data structures.

Or, as others have said, roll your own.

Good luck,
Scott



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.