<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
					xmlns:content="http://purl.org/rss/1.0/modules/content/"
					xmlns:wfw="http://wellformedweb.org/CommentAPI/"
					xmlns:atom="http://www.w3.org/2005/Atom"
				  >
<channel>
<atom:link rel="self"  type="application/rss+xml"  href="http://rulinux.net/rss_from_sect_4_subsect_6_thread_2307"  />
<title>rulinux.net - Форум - Development - Re:[linux][malloc]</title>
<link>http://rulinux.net/</link>
<description><![CDATA[Портал о GNU/Linux и не только]]></description>
<image><title>rulinux.net - Форум - Development - Re:[linux][malloc]</title>
<link>http://rulinux.net/</link>
<url>http://rulinux.net/rss_icon.png</url>
</image>
<item>
<title>Re:[linux][malloc]</title>
<link>https://rulinux.net/message.php?newsid=2307&amp;page=1#16124</link>
<guid>https://rulinux.net/message.php?newsid=2307&amp;page=1#16124</guid>
<pubDate>Wed, 24 Jun 2009 06:47:51 +0400</pubDate>
<description><![CDATA[<p>проверки нужны всегда и везде, а поведение malloc регулируется
/proc/sys/vm/overcommit_memory</p>]]></description>
</item>
<item>
<title>Re:[linux][malloc]</title>
<link>https://rulinux.net/message.php?newsid=2307&amp;page=1#16125</link>
<guid>https://rulinux.net/message.php?newsid=2307&amp;page=1#16125</guid>
<pubDate>Wed, 24 Jun 2009 06:17:14 +0400</pubDate>
<description><![CDATA[<p>Зашибись! Просто классно! Выделяешь память, проверил, что она не NULL, потом memcpy и на тебе &#8211; Segmentation fault на ровном месте.</p><p>Получается проверка <fieldset style="border: 1px dashed black; padding:0px;"><ol style="background-color:#3d3d3d;" start="1"> if (p=malloc(n)) != NULL </ol></fieldset> нафиг не нужна?</p><p>Поддерживаю, Линукс действительно broken в этом месте, не смотря на все преимущества данного оптимистичного подхода к распределению памяти.</p>]]></description>
</item>
<item>
<title>Re:[linux][malloc]</title>
<link>https://rulinux.net/message.php?newsid=2307&amp;page=1#16123</link>
<guid>https://rulinux.net/message.php?newsid=2307&amp;page=1#16123</guid>
<pubDate>Tue, 23 Jun 2009 15:47:26 +0400</pubDate>
<description><![CDATA[<p>Что-то похожее действительно наблюдается. Оптимистичным выделением памяти называется, если я ничего не путаю. </p>]]></description>
</item>
<item>
<title>Re:[linux][malloc]</title>
<link>https://rulinux.net/message.php?newsid=2307&amp;page=1#16121</link>
<guid>https://rulinux.net/message.php?newsid=2307&amp;page=1#16121</guid>
<pubDate>Tue, 23 Jun 2009 13:56:22 +0400</pubDate>
<description><![CDATA[<p><a href="http://www.win.tue.nl/~aeb/linux/lk/lk-9.html">http://www.win.tue.nl/~aeb/linux/lk/lk-9.html</a></p><p>Normally, a user-space program reserves (virtual) memory by calling malloc(). If the return value is NULL, the program knows that no more memory is available, and can do something appropriate. Most programs will print an error message and exit, some first need to clean up lockfiles or so, and some smarter programs can do garbage collection, or adapt the computation to the amount of available memory. This is life under Unix, and all is well.</p><p>Linux on the other hand is seriously broken. It will by default answer "yes" to most requests for memory, in the hope that programs ask for more than they actually need. If the hope is fulfilled Linux can run more programs in the same memory, or can run a program that requires more virtual memory than is available. And if not then very bad things happen.</p>]]></description>
</item>
<item>
<title>[linux][malloc]</title>
<link>https://rulinux.net/message.php?newsid=2307&amp;page=1#16122</link>
<guid>https://rulinux.net/message.php?newsid=2307&amp;page=1#16122</guid>
<pubDate>Tue, 23 Jun 2009 13:56:22 +0400</pubDate>
<description><![CDATA[<p><a href="http://netsago.org/ru/docs/1/14/">http://netsago.org/ru/docs/1/14/</a></p><p style="font-style:italic">&gt В спецификации C указано, что malloc должна вернуть NULL в случае, если памяти недостаточно, чтобы удовлетворить запрос. Linux <em>не полностью следует этому правилу</em>: он возвращает NULL, если в системе нет достаточного виртуального пространства адресов, чтобы выполнить выделение памяти, но в случае недостатка памяти, Linux по-прежнему выделяет пространство адресов, а затем возвращает ошибку, если вы пытаетесь использовать эту память.</p><p>Что, правда???</p>]]></description>
</item>
</channel>
</rss>