artzub
@artzub
Программист

Как бороться с ошибкой: couldn't commit memory for cygwin heap?

Привет!


есть код:
<font color="black">awk <font color="#A31515">'<br/>
  BEGIN {<br/>
    split(&quot;\b\b\b\b\b. . . . . \b- \b\b- \b\b- \b\b- \b\b- \b= = = = =&quot;, st, &quot; &quot;)<br/>
    i=0<br/>
  }<br/>
  /^[0-9]/ { <br/>
    sub(/:.*/, &quot;&quot;);<br/>
    d=$0;<br/>
    next;<br/>
  }    <br/>
  /^&/ {<br/>
    sub(/&/, &quot;&quot;);<br/>
    f=$0<br/>
    substr($0, 2, length($0) - 1);<br/>
    next;<br/>
  }<br/>
  /^+/ { a=&quot;A&quot;; }<br/>
  /^-/ { a=&quot;D&quot;; }    <br/>
  /^[\+-]/ {       <br/>
    fflush(&quot;&quot;)<br/>
    sub(/[\+-]/, &quot;&quot;)                  <br/>
    &quot;echo \&quot;&quot; $0 &quot;\&quot; | md5sum | cut -f1 -d \&quot; \&quot; | sed -e \&quot;s@[32|16]@/sd@g\&quot;&quot; | getline str; close(&quot;&quot;)<br/>
    print &quot;&quot;<br/>
    system(&quot;echo -ne \&quot;&quot; st[i++] &quot;\&quot; &gt;&2&quot;)<br/>
    if (i &gt; 16) i=0<br/>
  }    <br/>
' $gitdiff | \<br/>
sed -e <font color="#A31515">'s/\(filename=&quot;[^&quot;]&quot;\)/\1/'</font>  <br/>
</font><br/>
<font color="gray">* This source code was highlighted with <a href="http://virtser.net/blog/post/source-code-highlighter.aspx"><font color="gray">Source Code Highlighter</font></a>.</font></font>


есть файл из которого берутся данные


при выполнение вылетает ошибка


C:\Program Files\Git\bin\sh.exe: *** couldn't commit memory for cygwin heap, Win32 error 487

C:\Program Files\Git\bin\sh.exe: *** couldn't commit memory for cygwin heap, Win32 error 487

C:\Program Files\Git\bin\gawk.exe: *** couldn't commit memory for cygwin heap, Win32 error 487


помогите понять почему?

upd: может дело в длине данных?
  • Вопрос задан
  • 2759 просмотров
Решения вопроса 1
artzub
@artzub Автор вопроса
Программист
вообщем решил все дело в close
awk '
 BEGIN {
  split("\b\b\b\b\b. . . . . \b- \b\b- \b\b- \b\b- \b\b- \b= = = = =", st, " ")
  i=0
 }
 /^[0-9]/ {
  sub(/:.*/, "");
  d=$0;
  next;
 }  
 /^&/ {
  sub(/&/, "");
  f=$0
  substr($0, 2, length($0) - 1);
  next;
 }
 /^+/ { a="A"; }
 /^-/ { a="D"; }  
 /^[\+-]/ {   
  fflush("")
  sub(/[\+-]/, "")         
  cmd="echo \"" $0 "\" | md5sum | cut -f1 -d \" \" | sed -e \"s@[32|16]@/sd@g\""
  cmd | getline str;
  close(cmd)

  print ""
  system("echo -ne \"" st[i++] "\" >&2")
  if (i > 16) i=0
 }  
'
$gitdiff | \
sed -e 's/\(filename="[^"]"\)/\1/'


* This source code was highlighted with Source Code Highlighter.
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы