TIP: Click on subject to list as thread! ANSI
echo: linux
to: Gerrit Kuehn
from: Oleg Artemjev
date: 2021-04-25 16:13:00
subject: memleak :)

Hello, Gerrit Kuehn.
On 4/16/21 8:44 AM you wrote:

 MK>> After +20 some odd years I have yet to see that happen.
 GK> Just start an application that runs into a memory leak...

--------cut memleak.c -------
#define gigs = 8 // your gigabytes here
#include 
int main() {
  long int i=0;
  while(i<1024*1024*1024*gigs/2) {
    void *nofree = malloc(++i);
  }
  return 0;
}
---------cut-------

Try this w/ gcc -o memleak memleak.c; ./memleak

No free() after malloc() should give memory leak, isn't it?

--
Best regards!
Posted using Hotdoged on Android
--- Hotdoged/2.13.5/Android
                                                                                                                          
* Origin: Android device, Milky Way (2:5020/2141.808)

SOURCE: echomail via QWK@pharcyde.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.