View Single Post
Re: megaHAL enthusiasm
Old
  (#4)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: megaHAL enthusiasm - 05-01-2004

"If you are trying to find a word, I understand the offset thing where it is incrementing the point from the start of the word you want, yeah? So you make a word equal a point in the input string, but what you actually stored is the whole string from a certain point, so it's not actually a word?"
Yes, that's exactly it. It's difficult to explain, and sometimes I'm not sure to understand it completely myself

There is no real memory leak, since it's always the same dictionary which is used again and again : it's the bot's "input_words" dictionary. When the first replies come, the dictionary is empty, so the words in it get mallocated(). THEN, as other replies come to the chat window, the words that were mallocated() get reallocated() and the other words that were NOT mallocated() yet are allocated. All this stuff is freed when the bot disconnects, and only there (at least it's so in the RACC template #2).

They may be memory leaks elsewhere, but this is not one of them. How did you do to notice that memory was leaking ?



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote