どもです。 オートミールを食べ始めたせいか,便通がよろしいようで,快便ですたいっ! malloc(3) ではまる。 メモリ関連のコードを書いていて,テストを書いて,テストでこけた。 printf で原因を調べると,どうやらアラインメントの問題でこけているようだった。 あるサイズの倍数のアドレスで割り当ててるはずが,そうなってない。 自分で書いたコードには問題が見つからず。 というわけで,man malloc してみた。 一部抜粋。 For calloc() and malloc(), return a pointer to the allocated memory, which is suitably aligned for any kind of variable.どうやら,calloc(), malloc() ともに, いい具合にアラインメントを調整してくれるようだ。 何がいい具合か知