• 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: NSMakePoint and such - what about memory allocation?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMakePoint and such - what about memory allocation?


  • Subject: Re: NSMakePoint and such - what about memory allocation?
  • From: Jim Witte <email@hidden>
  • Date: Fri, 21 May 2004 19:56:21 -0500

FWIW, this seems to stem from the fact that you don't get any sort of implicit constructor for structs, i.e. you can't embed NSPoint(x, y) in your code... this has annoyed me on hundreds of occasions; I can't even begin to imagine what the creators of C were thinking when they overlooked this.**

So you can't write p = NSMakeLine( NSPoint(50,50), NSPoint(100,100) );

Couldn't a smart compiler, just as it turns NSPoint(50,50) into the direct-assignment statements, do something similar to this (in something almost resembling ARM assembly):

mov r0, #50
mov r1, r0
mov r2, #100
mov r3, r2
bl NSMakeLine__10NSMakeLine_I__T13
mov <p>, r0

Jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: NSMakePoint and such - what about memory allocation?
      • From: Nicko van Someren <email@hidden>
References: 
 >NSMakePoint and such - what about memory allocation? (From: Christoffer Lerno <email@hidden>)

  • Prev by Date: Re: [firstPath appendBezierPath: [secondPathbezierPathByReversingPath]];
  • Next by Date: Re: Avoiding == and = mixup in if statements
  • Previous by thread: Re: NSMakePoint and such - what about memory allocation?
  • Next by thread: Re: NSMakePoint and such - what about memory allocation?
  • Index(es):
    • Date
    • Thread