<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
 <channel>
  <atom:link href="https://smaugmuds.afkmods.com/index.php?a=rssfeed&amp;t=4447" rel="self" type="application/rss+xml" />
  <title>SmaugMuds - Topic: Help with garbage variables</title>
  <link>https://smaugmuds.afkmods.com/index.php?a=rssfeed&amp;t=4447</link>
  <description>The largest Smaug community resource site. - </description>
  <language>en</language>
  <generator>SmaugMuds</generator>
  <ttl>60</ttl>
  <item>
   <title>Help with garbage variables</title>
   <link>https://smaugmuds.afkmods.com/topic/help-with-garbage-variables-4447/&amp;p=20937#p20937</link>
   <description>It really isn&#039;t to bad and I long ago decided to just put everything in it instead of using both shared and non shared strings to make it easier to keep track of.</description>
   <guid isPermaLink="true">https://smaugmuds.afkmods.com/topic/help-with-garbage-variables-4447/&amp;p=20937#p20937</guid>
   <pubDate>Mon, 9 Aug 2010 19:42:18 CDT</pubDate>
   <category>SWR FUSS</category>
   <author>nobody@example.com (Remcon)</author>
  </item>
  <item>
   <title>Help with garbage variables</title>
   <link>https://smaugmuds.afkmods.com/topic/help-with-garbage-variables-4447/&amp;p=20922#p20922</link>
   <description>Shared strings introduce a (very small) amount of overhead during creation and freeing, and take up a (very small) amount of extra memory. Additionally, shared strings are, well, shared, so you can&#039;t just modify it as you please: you need to create a temporary copy, modify it, and then put it back into the shared string system. So you would not use a shared string if: - you were very concerned about every last byte of memory and processor instruction (the chances of this being true are next </description>
   <guid isPermaLink="true">https://smaugmuds.afkmods.com/topic/help-with-garbage-variables-4447/&amp;p=20922#p20922</guid>
   <pubDate>Sun, 8 Aug 2010 23:10:38 CDT</pubDate>
   <category>SWR FUSS</category>
   <author>nobody@example.com (David Haley)</author>
  </item>
  <item>
   <title>Help with garbage variables</title>
   <link>https://smaugmuds.afkmods.com/topic/help-with-garbage-variables-4447/&amp;p=20919#p20919</link>
   <description> [quote=David Haley][quote]What&#039;s the difference between str_dup/dispose and the STRFREE/ALLOC anyway? [/quote] &amp;lt;br /&amp;gt; STRFREE and STRALLOC use a shared string mechanism (using reference counting) whereas str_dup and dispose don&#039;t. So, dispose will delete memory immediately even if other strings are using it; strfree on a non-shared pointer will look for reference count data that doesn&#039;t exist.[/quote]What&#039;s an example of a situation where str_dup would be favored over STRALLOC?</description>
   <guid isPermaLink="true">https://smaugmuds.afkmods.com/topic/help-with-garbage-variables-4447/&amp;p=20919#p20919</guid>
   <pubDate>Sun, 8 Aug 2010 08:00:20 CDT</pubDate>
   <category>SWR FUSS</category>
   <author>nobody@example.com (Banner)</author>
  </item>
  <item>
   <title>Help with garbage variables</title>
   <link>https://smaugmuds.afkmods.com/topic/help-with-garbage-variables-4447/&amp;p=20918#p20918</link>
   <description>[quote]What&#039;s the difference between str_dup/dispose and the STRFREE/ALLOC anyway? [/quote] STRFREE and STRALLOC use a shared string mechanism (using reference counting) whereas str_dup and dispose don&#039;t. So, dispose will delete memory immediately even if other strings are using it; strfree on a non-shared pointer will look for reference count data that doesn&#039;t exist.</description>
   <guid isPermaLink="true">https://smaugmuds.afkmods.com/topic/help-with-garbage-variables-4447/&amp;p=20918#p20918</guid>
   <pubDate>Sun, 8 Aug 2010 01:00:32 CDT</pubDate>
   <category>SWR FUSS</category>
   <author>nobody@example.com (David Haley)</author>
  </item>
  <item>
   <title>Help with garbage variables</title>
   <link>https://smaugmuds.afkmods.com/topic/help-with-garbage-variables-4447/&amp;p=20917#p20917</link>
   <description>[quote=Kayle]You need to double check that the clan names aren&#039;t being assigned using str_dup anywhere. They all need to use the same. if you want to use STRALLOC/STRFREE on the clan_name fields, then ALL changes to clan_name need to use STRALLOC/STRFREE, not just the accounts part of things.[/quote] Everywhere I access the player-&amp;gt;clan variable I use STRFREE/ALLOC. Does that mean this is bad (can I not smash an str_dupped variable into a STRALLOC&#039;d variable)? [code] ch-&amp;gt;pcdata-&amp;gt;clan-&amp;gt;name </description>
   <guid isPermaLink="true">https://smaugmuds.afkmods.com/topic/help-with-garbage-variables-4447/&amp;p=20917#p20917</guid>
   <pubDate>Sat, 7 Aug 2010 13:32:45 CDT</pubDate>
   <category>SWR FUSS</category>
   <author>nobody@example.com (Banner)</author>
  </item>
  <item>
   <title>Help with garbage variables</title>
   <link>https://smaugmuds.afkmods.com/topic/help-with-garbage-variables-4447/&amp;p=20914#p20914</link>
   <description>[quote] [code] if( ch-&amp;gt;pcdata-&amp;gt;clan ) { if( player-&amp;gt;clan ) STRFREE( player-&amp;gt;clan ); player-&amp;gt;clan = STRALLOC( ch-&amp;gt;pcdata-&amp;gt;clan-&amp;gt;name ); } else { if( player-&amp;gt;clan )               STRFREE( player-&amp;gt;clan ); // LINE 178 player-&amp;gt;clan = STRALLOC( &amp;quot;&amp;quot; ); } [/code] [/quote] Instead of doing it like that I would do it like this [code] player-&amp;gt;clan = N</description>
   <guid isPermaLink="true">https://smaugmuds.afkmods.com/topic/help-with-garbage-variables-4447/&amp;p=20914#p20914</guid>
   <pubDate>Sat, 7 Aug 2010 11:38:32 CDT</pubDate>
   <category>SWR FUSS</category>
   <author>nobody@example.com (Remcon)</author>
  </item>
  <item>
   <title>Help with garbage variables</title>
   <link>https://smaugmuds.afkmods.com/topic/help-with-garbage-variables-4447/&amp;p=20912#p20912</link>
   <description>You need to double check that the clan names aren&#039;t being assigned using str_dup anywhere. They all need to use the same. if you want to use STRALLOC/STRFREE on the clan_name fields, then ALL changes to clan_name need to use STRALLOC/STRFREE, not just the accounts part of things.</description>
   <guid isPermaLink="true">https://smaugmuds.afkmods.com/topic/help-with-garbage-variables-4447/&amp;p=20912#p20912</guid>
   <pubDate>Sat, 7 Aug 2010 09:34:13 CDT</pubDate>
   <category>SWR FUSS</category>
   <author>nobody@example.com (InfiniteAxis)</author>
  </item>
  <item>
   <title>Help with garbage variables</title>
   <link>https://smaugmuds.afkmods.com/topic/help-with-garbage-variables-4447/&amp;p=20909#p20909</link>
   <description></description>
   <guid isPermaLink="true">https://smaugmuds.afkmods.com/topic/help-with-garbage-variables-4447/&amp;p=20909#p20909</guid>
   <pubDate>Fri, 6 Aug 2010 19:32:37 CDT</pubDate>
   <category>SWR FUSS</category>
   <author>nobody@example.com (Banner)</author>
  </item>
 </channel>
</rss>
