<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>qnighy</author_name>
  <author_url>https://blog.hatena.ne.jp/qnighy/</author_url>
  <blog_title>簡潔なQ</blog_title>
  <blog_url>https://qnighy.hatenablog.com/</blog_url>
  <categories>
    <anon>Programming</anon>
    <anon>C</anon>
  </categories>
  <description>クイックソートの最悪ケースの実証しようかなーと思ってglibcのソースを見たらクイックソートじゃなかった。まだちゃんとは読んでないが、次のような仕様ではないかと思われる。 まず、必要な一時領域のサイズを決定する。 通常は元の配列と同じ。(nmemb * size) sizeが32bytesより大きい場合は間接ソートを行うので、2*nmemb*sizeof(void*)+s必要。 一時領域を確保する。 一時領域が1024bytesより小さい場合はスタックから確保(alloca)する。 そうでなければmallocを試みる。 必要量がページサイズの1/4以上であるか、mallocに失敗した場合は、一…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fqnighy.hatenablog.com%2Fentry%2F20090430%2F1241054709&quot; title=&quot;glibcのqsort()はクイックソートではない - 簡潔なQ&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>2009-04-30 10:25:09</published>
  <title>glibcのqsort()はクイックソートではない</title>
  <type>rich</type>
  <url>https://qnighy.hatenablog.com/entry/20090430/1241054709</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
