Question

I need to know how can I find the memory alignment of my computer (windows 7). It is because I am writing my thesis and the 4rd party DSP communication board I am using has its dll data sent and received with 4096 alignment but the question is why is this so? and to find this first I must know what is the alignment for my PC.

Was it helpful?

Solution 2

Hi as I mentioned in the comment above but just to clarify that my issue is resolved since I get to know that for PCIe the maximum alignment is 4096 bytes.

thanks

OTHER TIPS

From 'man memalign' - begin from here. The DSP component can use another alignment from the PC, it depends on his internal architecture and the bus connects it with its host.

   On many systems there are alignment restrictions, for example,  on  buffers  used  for  direct  block
   device  I/O.  POSIX specifies the pathconf(path,_PC_REC_XFER_ALIGN) call that tells what alignment is
   needed.  Now one can use posix_memalign() to satisfy this requirement.

   posix_memalign() verifies that alignment matches the requirements detailed above.  memalign() may not
   check that the boundary argument is correct.

   POSIX  requires  that memory obtained from posix_memalign() can be freed using free(3).  Some systems
   provide no way to reclaim memory allocated with memalign() or valloc() (because one can only pass  to
   free(3) a pointer gotten from malloc(3), while, for example, memalign() would call malloc(3) and then
   align the obtained value).  The glibc implementation allows memory obtained from any of  these  three
   routines to be reclaimed with free(3).

   The glibc malloc(3) always returns 8-byte aligned memory addresses, so these routines are only needed
   if you require larger alignment values.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top