Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import <Foundation/Foundation.h>
- int main (int argc, const char * argv[]) {
- NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
- int *x = malloc(sizeof(int));
- void *foo = x;
- NSMutableData *d = [NSMutableData dataWithBytesNoCopy:foo length:sizeof(int) freeWhenDone:NO];
- NSLog(@"a: %p", [d mutableBytes]);
- NSLog(@"b: %p", foo);
- assert([d mutableBytes] == foo);
- free(x);
- [pool drain];
- return 0;
- }
Add Comment
Please, Sign In to add comment