<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>
    <dl style="line-height: 1.5; margin-left: 2em">
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Author</dt>
      <dd style="margin-left: 8.5em">Kouhei Sutou &lt;kou****@clear*****&gt;</dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Date</dt>
      <dd style="margin-left: 8.5em">2018-02-21 12:04:53 +0900 (Wed, 21 Feb 2018)</dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">New Revision</dt>
      <dd style="margin-left: 8.5em"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145">be43625add91de0055f2b056b6f0a6c91861d145</a></dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Message</dt>
      <dd style="margin-left: 8.5em"><pre style="border: 1px solid #aaa; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; padding: 0.5em; width: auto">ii: increase encode buffer size

The previous size isn&#39;t enough for large data.</pre></dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Modified files</dt>
      <dd style="margin-left: 8.5em">
        <ul>
          <li><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758a">lib/ii.c</a></li>
        </ul>
      </dd>
    </dl>

    <div class="diff-section" style="clear: both">
      <table style="border-collapse: collapse; border: 1px solid #aaa">
        <thead>
          <tr class="diff-header" style="border: 1px solid #aaa">
            <td colspan="3">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">  Modified: lib/ii.c (+3 -1)</span>
<span class="diff-header-mark" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">===================================================================</span>
</pre>
            </td>
          </tr>
        </thead>
        <tbody>
          <tr>
            <th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aL2935">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aL2936">2936</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aL2937">2937</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aL2938">2938</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aL2939">2939</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aL2940">2940</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aL2941">2941</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aL2951">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aL2952">2952</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aL2953">2953</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aL2954">2954</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffecec; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aL2955">2955</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aL2956">2956</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aL2957">2957</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aL2958">2958</a></span>
</pre>
            </th>
            <th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aR2935">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aR2936">2936</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aR2937">2937</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aR2938">2938</a></span>
<span class="diff-line-number-added" style="background-color: #eaffea; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aR2939">2939</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aR2940">2940</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aR2941">2941</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aR2942">2942</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aR2952">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aR2953">2953</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aR2954">2954</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aR2955">2955</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-added" style="background-color: #eaffea; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aR2956">2956</a></span>
<span class="diff-line-number-added" style="background-color: #eaffea; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aR2957">2957</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aR2958">2958</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aR2959">2959</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/be43625add91de0055f2b056b6f0a6c91861d145#diff-cf87acdbcbd22709a858df5c01e6758aR2960">2960</a></span>
</pre>
            </th>
            <td class="diff-content" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -2936,6 +2936,7 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">chunk_merge(grn_ctx *ctx, grn_ii *ii, buffer *sb, buffer_term *bt,</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre">   if (ctx-&gt;rc == GRN_SUCCESS) {</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     int j = 0;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     uint8_t *enc;</span>
<span class="diff-added" style="background-color: #eaffea; color: #000000; display: block; white-space: pre">+    uint32_t encsize_probably_enough;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     uint32_t encsize;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     uint32_t np = posp - dv[ii-&gt;n_elements - 1].data;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     uint32_t f_s = (ndf &lt; 3) ? 0 : USE_P_ENC;</span>
<span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -2952,7 +2953,8 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">chunk_merge(grn_ctx *ctx, grn_ii *ii, buffer *sb, buffer_term *bt,</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre">       uint32_t f_p = ((np &lt; 32) || (np &lt;= (spos &gt;&gt; 13))) ? 0 : USE_P_ENC;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">       dv[j].data_size = np; dv[j].flags = f_p|ODD;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     }</span>
<span class="diff-deleted" style="background-color: #ffecec; color: #000000; display: block; white-space: pre">-    if ((enc = GRN_MALLOC((ndf * 4 + np) * 2))) {</span>
<span class="diff-added" style="background-color: #eaffea; color: #000000; display: block; white-space: pre">+    encsize_probably_enough = (ndf * 4 + np) * 3;</span>
<span class="diff-added" style="background-color: #eaffea; color: #000000; display: block; white-space: pre">+    if ((enc = GRN_MALLOC(encsize_probably_enough))) {</span>
<span class="diff-not-changed" style="display: block; white-space: pre">       encsize = grn_p_encv(ctx, dv, ii-&gt;n_elements, enc);</span>
<span class="diff-not-changed" style="display: block; white-space: pre">       chunk_flush(ctx, ii, cinfo, enc, encsize);</span>
<span class="diff-not-changed" style="display: block; white-space: pre">       if (ctx-&gt;rc == GRN_SUCCESS) {</span>
</pre>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>