Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove unused old stuff

  • Loading branch information...
commit d768b7fc840d1efe5cba8bf9444270ebe80d381d 1 parent c0500a7
@atomicbird authored
Showing with 0 additions and 31 deletions.
  1. +0 −31 NSData+reallyMapped.m
View
31 NSData+reallyMapped.m
@@ -9,28 +9,8 @@
#import "NSData+reallyMapped.h"
#import <sys/fcntl.h>
#import <sys/mman.h>
-//#import <objc/runtime.h>
#import "NSObject+deallocBlock.h"
-/*
-static char *mappedFilePointerKey = "mappedFilePointer";
-// This class exists to do an end-run around the problem of not being able to override -dealloc in a category.
-@interface MappedFilePointerValue : NSObject
-@property (readwrite, assign) void *mapPointer;
-@property (readwrite, assign) NSInteger mapSize;
-@end
-@implementation MappedFilePointerValue
-@synthesize mapSize = mapSize_;
-@synthesize mapPointer = mapPointer_;
-
-- (void)dealloc
-{
- munmap([self mapPointer], [self mapSize]);
- [super dealloc];
-}
-
-@end
-*/
@implementation NSData (reallyMapped)
+ (NSData *)dataWithContentsOfReallyMappedFile:(NSString *)path;
@@ -62,19 +42,8 @@ + (NSData *)dataWithContentsOfReallyMappedFile:(NSString *)path;
NSData *mappedData = [NSData dataWithBytesNoCopy:mappedFile length:[fileSize intValue] freeWhenDone:NO];
[mappedData addDeallocBlock:^{
- NSLog(@"Runing dealloc block");
munmap(mappedFile, [fileSize intValue]);
}];
- [mappedData addDeallocBlock:^{
- NSLog(@"Gratuitous second dealloc block");
- }];
- /*
- // Save off important data so that the map will be cleaned up when the NSData deallocs.
- MappedFilePointerValue *mapValue = [[[MappedFilePointerValue alloc] init] autorelease];
- [mapValue setMapPointer:mappedFile];
- [mapValue setMapSize:[fileSize integerValue]];
- objc_setAssociatedObject(mappedData, &mappedFilePointerKey, mapValue, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
-*/
return mappedData;
}
Please sign in to comment.
Something went wrong with that request. Please try again.