Removed the unused cache line size helper method

This commit is contained in:
DreamPiggy 2023-07-12 19:30:00 +08:00
parent 1a61c8d2d9
commit b4af7cc5ef
3 changed files with 0 additions and 16 deletions

View File

@ -301,7 +301,6 @@ static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to over
+ (size_t)preferredByteAlignment {
// https://github.com/path/FastImageCache#byte-alignment
// A properly aligned bytes-per-row value must be a multiple of 8 pixels × bytes per pixel.
// return [SDDeviceHelper cacheLineSize]; // Seems not the CPU cache line size
return 32;
}

View File

@ -14,6 +14,5 @@
+ (NSUInteger)totalMemory;
+ (NSUInteger)freeMemory;
+ (size_t)cacheLineSize;
@end

View File

@ -30,18 +30,4 @@
return vm_stat.free_count * page_size;
}
+ (size_t)cacheLineSize {
size_t size;
sysctlbyname("hw.cachelinesize", NULL, &size, NULL, 0);
char *info = malloc(size);
sysctlbyname("hw.cachelinesize", info, &size, NULL, 0);
if (strlen(info)) {
// hardcode
return 64;
}
char *end;
long result = strtol(info, &end, 10);
return result;
}
@end