• 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
memcpy with 64 bit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

memcpy with 64 bit


  • Subject: memcpy with 64 bit
  • From: "gMail.com" <email@hidden>
  • Date: Mon, 14 Dec 2009 19:27:56 +0100
  • Thread-topic: memcpy with 64 bit

Hi,
if I compile this code against "32-bits Universal", it works.
If I compile this code against "64-bit Intel", it doesn't work.
I get a bad access error just on memcpy. What do I miss? I use:

    Base SDK 10.6
    i386 ppc ppc64 ppc7400 ppc970 x86_64
    GCC 4.2 or 4.0
    Target Mac OS X 10.6
    Active Architecture x86_64

- (void)LoadImageData:(NSData*)imageData
                       pointer:(void*)handle
                               h:(GLuint)imageHeight
{
    NSBitmapImageRep    *bitmap = [[NSBitmapImageRep alloc]
                                                    initWithData:imageData];
    int                         bytesPRow = [bitmap bytesPerRow];
    unsigned char        *theImageData = [bitmap bitmapData];
    int                         rowNum;

    for(rowNum = 0; rowNum < imageHeight; rowNum++){
        memcpy(handle + (rowNum * bytesPRow),
                     theImageData + (rowNum * bytesPRow), bytesPRow);
    }

    [bitmap release];
}


Best Regards
--
Leonardo


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: memcpy with 64 bit
      • From: Quincey Morris <email@hidden>
    • Re: memcpy with 64 bit
      • From: Mike Abdullah <email@hidden>
    • Re: memcpy with 64 bit
      • From: "Hank Heijink (Mailinglists)" <email@hidden>
  • Prev by Date: Re: Crash when 'open POSIX file /..' from AppleScript
  • Next by Date: Re: Crash when 'open POSIX file /..' from AppleScript
  • Previous by thread: Re: Core Data Save As Binary Error
  • Next by thread: Re: memcpy with 64 bit
  • Index(es):
    • Date
    • Thread