自分のコンピューター (windows 7) のメモリ アラインメントを見つける方法を知る必要があります。それは私が論文を書いていて、私が使用しているサードパーティの DSP 通信ボードの dll データが 4096 アライメントで送受信されているためですが、なぜそうなのかという疑問があります。これを最初に見つけるには、自分の PC の配置を知る必要があります。
2 に答える
0
「man memalign」より - ここから始めます。DSP コンポーネントは、PC からの別の配置を使用できます。これは、内部アーキテクチャに依存し、バスがそれをホストに接続します。
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.
于 2013-12-25T14:08:34.970 に答える
0
こんにちは、上記のコメントで述べたように、PCIe の最大アラインメントが 4096 バイトであることを知ったので、問題が解決したことを明確にするためです。
ありがとう
于 2013-12-26T13:39:50.877 に答える