• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Of input loops and games
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Of input loops and games


  • Subject: Re: Of input loops and games
  • From: Hari Seldon <email@hidden>
  • Date: Wed, 21 Sep 2005 17:29:10 -0500

Thanks for your reply.

On 9/21/05, Sherm Pendley <email@hidden> wrote:
> You can "stack" as many autorelease pools as you need. When a new
> pool is created, it's added to the top of the stack. When an object
> is autoreleased, it's added to the top pool on the stack.
>
> AppKit creates a new autorelease pool at the beginning of each
> iteration through its run loop, and releases that pool at the end.
> You could do something similar. In pseudo-code:

I was aware of that; I'm under the impression that if I create a new
thread, I don't get to use AppKit's automatically created autorelease
pool.

>
> - (void)start_move_loop() {
>      int end_loop = 0;
>      while (end_loop == 0) {
>          NSAutoreleasePool *subPool = [[NSAutoreleasePool alloc] init];
>
>          // Call get_key() and handle game events
>
>          [subPool release];
>      }
> }
>

Sadly, I don't have "control" over the start_move_loop function --
it's built into the original C code. Is it possible to clear the pool
on a timer, or would that raise problems?

> sherm--
>
> Cocoa programming in Perl: http://camelbones.sourceforge.net
> Hire me! My resume: http://www.dot-app.org
>
>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Of input loops and games
      • From: Jack Nutting <email@hidden>
References: 
 >Of input loops and games (From: Hari Seldon <email@hidden>)
 >Re: Of input loops and games (From: Jack Nutting <email@hidden>)
 >Re: Of input loops and games (From: Hari Seldon <email@hidden>)
 >Re: Of input loops and games (From: Sherm Pendley <email@hidden>)

  • Prev by Date: TIFFRepresentation/NSDragPboard issues
  • Next by Date: Re: TIFFRepresentation/NSDragPboard issues
  • Previous by thread: Re: Of input loops and games
  • Next by thread: Re: Of input loops and games
  • Index(es):
    • Date
    • Thread