<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>any-programming</author_name>
  <author_url>https://blog.hatena.ne.jp/any-programming/</author_url>
  <blog_title>何でもプログラミング</blog_title>
  <blog_url>https://any-programming.hatenablog.com/</blog_url>
  <categories>
    <anon>C++</anon>
  </categories>
  <description>SSEやAVXを利用して処理を高速化する際に、メモリ領域がアラインされている必要があります。アラインされた領域を確保するだけであれば_mm_mallocで可能ですが、_mm_freeを自分で呼ぶ必要があります。今回はstd::vectorでアラインされた領域を確保できるようにしたいと思います。 IsAligned まず第一にメモリがアラインされているか確認する関数が必要です。中身は至って簡単で、アドレス値がNで割り切れれば、NByteでアラインされています。 bool IsAligned(void* p, int n) { return (int)p % n == 0; } AlignedAl…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fany-programming.hatenablog.com%2Fentry%2F2017%2F04%2F28%2F122846&quot; title=&quot;アラインされたstd::vector - 何でもプログラミング&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-04-28 12:28:46</published>
  <title>アラインされたstd::vector</title>
  <type>rich</type>
  <url>https://any-programming.hatenablog.com/entry/2017/04/28/122846</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
