Welcome, Guest. Please login or register.

Author Topic: "Close Window" tutorial errors  (Read 3988 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show all replies
Re: "Close Window" tutorial errors
« on: May 12, 2003, 08:18:30 PM »
Quote

Just add the GimmeZeroZero flag, then Intuition does that for you.


I wouldn't do that. GZZ window uses more RAM and slows down system.
My Amigas: A500, Mac Mini and PowerBook
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show all replies
Re: "Close Window" tutorial errors
« Reply #1 on: May 12, 2003, 08:45:32 PM »
Quote

There is one additional major difference, mostly important for lazy (bad) programmers: malloc() does resource tracking. You can return from the program without explicitely calling free() and the startup code will return all allocated memory. Each AllocVec() *must* be matched by a FreeVec().


Advanced programmer should prefer AllocPooled() call over AllocMem()/AllocVec() calls IMO. No more memory leaks (just remember DeletePool() on exit) and you also avoid memory fragmentation when doing small allocations.
My Amigas: A500, Mac Mini and PowerBook