新的 SDWebImageCache.m 解決內(nèi)存增加很嚴(yán)重的問(wèn)題

/*

  • This file is part of the SDWebImage package.

  • (c) Olivier Poitrey rs@dailymotion.com

  • For the full copyright and license information, please view the LICENSE

  • file that was distributed with this source code.
    */

    #import "SDImageCache.h"
    #import "SDWebImageDecoder.h"
    #import "UIImage+MultiFormat.h"
     #import <CommonCrypto/CommonDigest.h>
    #import "UIImage+GIF.h"
     #import "NSData+ImageContentType.h"
     #import "NSImage+WebCache.h"
     #import "SDImageCacheConfig.h"
    
     // See https://github.com/rs/SDWebImage/pull/1141 for discussion
     @interface AutoPurgeCache : NSCache
     @end
    

@implementation AutoPurgeCache

  • (nonnull instancetype)init {
    self = [super init];
    if (self) {

if SD_UIKIT

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(removeAllObjects) name:UIApplicationDidReceiveMemoryWarningNotification object:nil];

endif

}
return self;

}

  • (void)dealloc {

if SD_UIKIT

[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidReceiveMemoryWarningNotification object:nil];

endif

}

@end

FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) {

if SD_MAC

return image.size.height * image.size.width;

elif SD_UIKIT || SD_WATCH

return image.size.height * image.size.width * image.scale * image.scale;

endif

}

@interface SDImageCache ()

pragma mark - Properties

@property (strong, nonatomic, nonnull) NSCache *memCache;
// +
@property (strong, nonatomic) NSMapTable *weakMemCache;
@property (strong, nonatomic, nonnull) NSString *diskCachePath;
@property (strong, nonatomic, nullable) NSMutableArray<NSString *> *customPaths;
@property (SDDispatchQueueSetterSementics, nonatomic, nullable) dispatch_queue_t ioQueue;

@end

@implementation SDImageCache {
NSFileManager *_fileManager;
}

pragma mark - Singleton, init, dealloc

  • (nonnull instancetype)sharedImageCache {
    static dispatch_once_t once;
    static id instance;
    dispatch_once(&once, ^{
    instance = [self new];
    });
    return instance;
    }
  • (instancetype)init {
    return [self initWithNamespace:@"default"];
    }

  • (nonnull instancetype)initWithNamespace:(nonnull NSString *)ns {
    NSString *path = [self makeDiskCachePath:ns];
    return [self initWithNamespace:ns diskCacheDirectory:path];
    }

  • (nonnull instancetype)initWithNamespace:(nonnull NSString *)ns
    diskCacheDirectory:(nonnull NSString *)directory {
    if ((self = [super init])) {
    NSString *fullNamespace = [@"com.hackemist.SDWebImageCache." stringByAppendingString:ns];

      // Create IO serial queue
      _ioQueue = dispatch_queue_create("com.hackemist.SDWebImageCache", DISPATCH_QUEUE_SERIAL);
      
      _config = [[SDImageCacheConfig alloc] init];
      
      // Init the memory cache
      _memCache = [[AutoPurgeCache alloc] init];
      _memCache.name = fullNamespace;
    

// +
// + // Init the weak memory cache (to keep a weak reference to images cleared from our memory cache that are actually still alive)
// +
_weakMemCache = [NSMapTable strongToWeakObjectsMapTable];

    // Init the disk cache
    if (directory != nil) {
        _diskCachePath = [directory stringByAppendingPathComponent:fullNamespace];
    } else {
        NSString *path = [self makeDiskCachePath:ns];
        _diskCachePath = path;
    }

    dispatch_sync(_ioQueue, ^{
        _fileManager = [NSFileManager new];
    });

if SD_UIKIT

    // Subscribe to app events
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(clearMemory)
                                                 name:UIApplicationDidReceiveMemoryWarningNotification
                                               object:nil];

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(deleteOldFiles)
                                                 name:UIApplicationWillTerminateNotification
                                               object:nil];

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(backgroundDeleteOldFiles)
                                                 name:UIApplicationDidEnterBackgroundNotification
                                               object:nil];

endif

}

return self;

}

  • (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    SDDispatchQueueRelease(_ioQueue);
    }

  • (void)checkIfQueueIsIOQueue {
    const char *currentQueueLabel = dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL);
    const char *ioQueueLabel = dispatch_queue_get_label(self.ioQueue);
    if (strcmp(currentQueueLabel, ioQueueLabel) != 0) {
    NSLog(@"This method should be called from the ioQueue");
    }
    }

pragma mark - Cache paths

  • (void)addReadOnlyCachePath:(nonnull NSString *)path {
    if (!self.customPaths) {
    self.customPaths = [NSMutableArray new];
    }

    if (![self.customPaths containsObject:path]) {
    [self.customPaths addObject:path];
    }
    }

  • (nullable NSString *)cachePathForKey:(nullable NSString *)key inPath:(nonnull NSString *)path {
    NSString *filename = [self cachedFileNameForKey:key];
    return [path stringByAppendingPathComponent:filename];
    }

  • (nullable NSString *)defaultCachePathForKey:(nullable NSString *)key {
    return [self cachePathForKey:key inPath:self.diskCachePath];
    }

  • (nullable NSString *)cachedFileNameForKey:(nullable NSString *)key {
    const char *str = key.UTF8String;
    if (str == NULL) {
    str = "";
    }
    unsigned char r[CC_MD5_DIGEST_LENGTH];
    CC_MD5(str, (CC_LONG)strlen(str), r);
    NSString *filename = [NSString stringWithFormat:@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%@",
    r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8], r[9], r[10],
    r[11], r[12], r[13], r[14], r[15], [key.pathExtension isEqualToString:@""] ? @"" : [NSString stringWithFormat:@".%@", key.pathExtension]];

    return filename;
    }

  • (nullable NSString )makeDiskCachePath:(nonnull NSString)fullNamespace {
    NSArray<NSString *> *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
    return [paths[0] stringByAppendingPathComponent:fullNamespace];
    }

pragma mark - Store Ops

  • (void)storeImage:(nullable UIImage *)image
    forKey:(nullable NSString *)key
    completion:(nullable SDWebImageNoParamsBlock)completionBlock {
    [self storeImage:image imageData:nil forKey:key toDisk:YES completion:completionBlock];
    }

  • (void)storeImage:(nullable UIImage *)image
    forKey:(nullable NSString *)key
    toDisk:(BOOL)toDisk
    completion:(nullable SDWebImageNoParamsBlock)completionBlock {
    [self storeImage:image imageData:nil forKey:key toDisk:toDisk completion:completionBlock];
    }

  • (void)storeImage:(nullable UIImage *)image
    imageData:(nullable NSData *)imageData
    forKey:(nullable NSString *)key
    toDisk:(BOOL)toDisk
    completion:(nullable SDWebImageNoParamsBlock)completionBlock {
    if (!image || !key) {
    if (completionBlock) {
    completionBlock();
    }
    return;
    }
    // if memory cache is enabled
    if (self.config.shouldCacheImagesInMemory) {
    NSUInteger cost = SDCacheCostForImage(image);

      // -
      //[self.memCache setObject:image forKey:key cost:cost];
      
      // +
      [self addImageToMemoryCache:image forKey:key];
    

    }

    if (toDisk) {
    dispatch_async(self.ioQueue, ^{
    NSData *data = imageData;

          if (!data && image) {
              SDImageFormat imageFormatFromData = [NSData sd_imageFormatForImageData:data];
              data = [image sd_imageDataAsFormat:imageFormatFromData];
          }
          
          [self storeImageDataToDisk:data forKey:key];
          if (completionBlock) {
              dispatch_async(dispatch_get_main_queue(), ^{
                  completionBlock();
              });
          }
      });
    

    } else {
    if (completionBlock) {
    completionBlock();
    }
    }
    }

  • (void)storeImageDataToDisk:(nullable NSData *)imageData forKey:(nullable NSString *)key {
    if (!imageData || !key) {
    return;
    }

    [self checkIfQueueIsIOQueue];

    if (![_fileManager fileExistsAtPath:_diskCachePath]) {
    [_fileManager createDirectoryAtPath:_diskCachePath withIntermediateDirectories:YES attributes:nil error:NULL];
    }

    // get cache Path for image key
    NSString *cachePathForKey = [self defaultCachePathForKey:key];
    // transform to NSUrl
    NSURL *fileURL = [NSURL fileURLWithPath:cachePathForKey];

    [_fileManager createFileAtPath:cachePathForKey contents:imageData attributes:nil];

    // disable iCloud backup
    if (self.config.shouldDisableiCloud) {
    [fileURL setResourceValue:@YES forKey:NSURLIsExcludedFromBackupKey error:nil];
    }
    }

pragma mark - Query and Retrieve Ops

  • (void)diskImageExistsWithKey:(nullable NSString *)key completion:(nullable SDWebImageCheckCacheCompletionBlock)completionBlock {
    dispatch_async(_ioQueue, ^{
    BOOL exists = [_fileManager fileExistsAtPath:[self defaultCachePathForKey:key]];

      // fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name
      // checking the key with and without the extension
      if (!exists) {
          exists = [_fileManager fileExistsAtPath:[self defaultCachePathForKey:key].stringByDeletingPathExtension];
      }
    
      if (completionBlock) {
          dispatch_async(dispatch_get_main_queue(), ^{
              completionBlock(exists);
          });
      }
    

    });
    }

  • (nullable UIImage *)imageFromMemoryCacheForKey:(nullable NSString *)key {
    // -
    //return [self.memCache objectForKey:key];

    //+
    UIImage *image = [self.memCache objectForKey:key];
    // Check the weak memory cache to see if a previously cached image is still alive
    if (!image) {
    image = [self.weakMemCache objectForKey:key];
    if (image) {
    // re-add to memory cache
    [self addImageToMemoryCache:image forKey:key];
    }
    }
    return image;
    }

// +

  • (void) addImageToMemoryCache:(UIImage *)image forKey:(NSString *)key {
    [self.memCache setObject:image forKey:key cost:image.size.height * image.size.width * image.scale];
    [self.weakMemCache setObject:image forKey:key];

}

  • (nullable UIImage *)imageFromDiskCacheForKey:(nullable NSString *)key {
    UIImage *diskImage = [self diskImageForKey:key];
    if (diskImage && self.config.shouldCacheImagesInMemory) {

      // -
      //NSUInteger cost = SDCacheCostForImage(diskImage);
      //[self.memCache setObject:diskImage forKey:key cost:cost];
      [self addImageToMemoryCache:diskImage forKey:key];
    

    }

    return diskImage;
    }

  • (nullable UIImage *)imageFromCacheForKey:(nullable NSString *)key {
    // First check the in-memory cache...
    UIImage *image = [self imageFromMemoryCacheForKey:key];
    if (image) {
    return image;
    }

    // Second check the disk cache...
    image = [self imageFromDiskCacheForKey:key];
    return image;
    }

  • (nullable NSData *)diskImageDataBySearchingAllPathsForKey:(nullable NSString *)key {
    NSString *defaultPath = [self defaultCachePathForKey:key];
    NSData *data = [NSData dataWithContentsOfFile:defaultPath];
    if (data) {
    return data;
    }

    // fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name
    // checking the key with and without the extension
    data = [NSData dataWithContentsOfFile:defaultPath.stringByDeletingPathExtension];
    if (data) {
    return data;
    }

    NSArray<NSString *> *customPaths = [self.customPaths copy];
    for (NSString *path in customPaths) {
    NSString *filePath = [self cachePathForKey:key inPath:path];
    NSData *imageData = [NSData dataWithContentsOfFile:filePath];
    if (imageData) {
    return imageData;
    }

      // fallback because of https://github.com/rs/SDWebImage/pull/976 that added the extension to the disk file name
      // checking the key with and without the extension
      imageData = [NSData dataWithContentsOfFile:filePath.stringByDeletingPathExtension];
      if (imageData) {
          return imageData;
      }
    

    }

    return nil;
    }

  • (nullable UIImage *)diskImageForKey:(nullable NSString *)key {
    NSData *data = [self diskImageDataBySearchingAllPathsForKey:key];
    if (data) {
    UIImage *image = [UIImage sd_imageWithData:data];
    image = [self scaledImageForKey:key image:image];
    if (self.config.shouldDecompressImages) {
    image = [UIImage decodedImageWithImage:image];
    }
    return image;
    }
    else {
    return nil;
    }
    }

  • (nullable UIImage *)scaledImageForKey:(nullable NSString *)key image:(nullable UIImage *)image {
    return SDScaledImageForKey(key, image);
    }

  • (nullable NSOperation *)queryCacheOperationForKey:(nullable NSString *)key done:(nullable SDCacheQueryCompletedBlock)doneBlock {
    if (!key) {
    if (doneBlock) {
    doneBlock(nil, nil, SDImageCacheTypeNone);
    }
    return nil;
    }

    // First check the in-memory cache...
    UIImage *image = [self imageFromMemoryCacheForKey:key];
    if (image) {
    NSData *diskData = nil;
    if ([image isGIF]) {
    diskData = [self diskImageDataBySearchingAllPathsForKey:key];
    }
    if (doneBlock) {
    doneBlock(image, diskData, SDImageCacheTypeMemory);
    }
    return nil;
    }

    NSOperation *operation = [NSOperation new];
    dispatch_async(self.ioQueue, ^{
    if (operation.isCancelled) {
    // do not call the completion if cancelled
    return;
    }

      @autoreleasepool {
          NSData *diskData = [self diskImageDataBySearchingAllPathsForKey:key];
          UIImage *diskImage = [self diskImageForKey:key];
          if (diskImage && self.config.shouldCacheImagesInMemory) {
              //NSUInteger cost = SDCacheCostForImage(diskImage);
              //[self.memCache setObject:diskImage forKey:key cost:cost];
              
              [self addImageToMemoryCache:diskImage forKey:key];
          }
    
          if (doneBlock) {
              dispatch_async(dispatch_get_main_queue(), ^{
                  doneBlock(diskImage, diskData, SDImageCacheTypeDisk);
              });
          }
      }
    

    });

    return operation;
    }

pragma mark - Remove Ops

  • (void)removeImageForKey:(nullable NSString *)key withCompletion:(nullable SDWebImageNoParamsBlock)completion {
    [self removeImageForKey:key fromDisk:YES withCompletion:completion];
    }

  • (void)removeImageForKey:(nullable NSString *)key fromDisk:(BOOL)fromDisk withCompletion:(nullable SDWebImageNoParamsBlock)completion {
    if (key == nil) {
    return;
    }

    if (self.config.shouldCacheImagesInMemory) {
    [self.memCache removeObjectForKey:key];
    }

    if (fromDisk) {
    dispatch_async(self.ioQueue, ^{
    [_fileManager removeItemAtPath:[self defaultCachePathForKey:key] error:nil];

          if (completion) {
              dispatch_async(dispatch_get_main_queue(), ^{
                  completion();
              });
          }
      });
    

    } else if (completion){
    completion();
    }

}

pragma mark - Mem Cache settings

  • (void)setMaxMemoryCost:(NSUInteger)maxMemoryCost {
    self.memCache.totalCostLimit = maxMemoryCost;
    }

  • (NSUInteger)maxMemoryCost {
    return self.memCache.totalCostLimit;
    }

  • (NSUInteger)maxMemoryCountLimit {
    return self.memCache.countLimit;
    }

  • (void)setMaxMemoryCountLimit:(NSUInteger)maxCountLimit {
    self.memCache.countLimit = maxCountLimit;
    }

pragma mark - Cache clean Ops

  • (void)clearMemory {
    [self.memCache removeAllObjects];
    }

  • (void)clearDiskOnCompletion:(nullable SDWebImageNoParamsBlock)completion {
    dispatch_async(self.ioQueue, ^{
    [_fileManager removeItemAtPath:self.diskCachePath error:nil];
    [_fileManager createDirectoryAtPath:self.diskCachePath
    withIntermediateDirectories:YES
    attributes:nil
    error:NULL];

      if (completion) {
          dispatch_async(dispatch_get_main_queue(), ^{
              completion();
          });
      }
    

    });
    }

  • (void)deleteOldFiles {
    [self deleteOldFilesWithCompletionBlock:nil];
    }

  • (void)deleteOldFilesWithCompletionBlock:(nullable SDWebImageNoParamsBlock)completionBlock {
    dispatch_async(self.ioQueue, ^{
    NSURL *diskCacheURL = [NSURL fileURLWithPath:self.diskCachePath isDirectory:YES];
    NSArray<NSString *> *resourceKeys = @[NSURLIsDirectoryKey, NSURLContentModificationDateKey, NSURLTotalFileAllocatedSizeKey];

      // This enumerator prefetches useful properties for our cache files.
      NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtURL:diskCacheURL
                                                 includingPropertiesForKeys:resourceKeys
                                                                    options:NSDirectoryEnumerationSkipsHiddenFiles
                                                               errorHandler:NULL];
    
      NSDate *expirationDate = [NSDate dateWithTimeIntervalSinceNow:-self.config.maxCacheAge];
      NSMutableDictionary<NSURL *, NSDictionary<NSString *, id> *> *cacheFiles = [NSMutableDictionary dictionary];
      NSUInteger currentCacheSize = 0;
    
      // Enumerate all of the files in the cache directory.  This loop has two purposes:
      //
      //  1. Removing files that are older than the expiration date.
      //  2. Storing file attributes for the size-based cleanup pass.
      NSMutableArray<NSURL *> *urlsToDelete = [[NSMutableArray alloc] init];
      for (NSURL *fileURL in fileEnumerator) {
          NSError *error;
          NSDictionary<NSString *, id> *resourceValues = [fileURL resourceValuesForKeys:resourceKeys error:&error];
    
          // Skip directories and errors.
          if (error || !resourceValues || [resourceValues[NSURLIsDirectoryKey] boolValue]) {
              continue;
          }
    
          // Remove files that are older than the expiration date;
          NSDate *modificationDate = resourceValues[NSURLContentModificationDateKey];
          if ([[modificationDate laterDate:expirationDate] isEqualToDate:expirationDate]) {
              [urlsToDelete addObject:fileURL];
              continue;
          }
    
          // Store a reference to this file and account for its total size.
          NSNumber *totalAllocatedSize = resourceValues[NSURLTotalFileAllocatedSizeKey];
          currentCacheSize += totalAllocatedSize.unsignedIntegerValue;
          cacheFiles[fileURL] = resourceValues;
      }
      
      for (NSURL *fileURL in urlsToDelete) {
          [_fileManager removeItemAtURL:fileURL error:nil];
      }
    
      // If our remaining disk cache exceeds a configured maximum size, perform a second
      // size-based cleanup pass.  We delete the oldest files first.
      if (self.config.maxCacheSize > 0 && currentCacheSize > self.config.maxCacheSize) {
          // Target half of our maximum cache size for this cleanup pass.
          const NSUInteger desiredCacheSize = self.config.maxCacheSize / 2;
    
          // Sort the remaining cache files by their last modification time (oldest first).
          NSArray<NSURL *> *sortedFiles = [cacheFiles keysSortedByValueWithOptions:NSSortConcurrent
                                                                   usingComparator:^NSComparisonResult(id obj1, id obj2) {
                                                                       return [obj1[NSURLContentModificationDateKey] compare:obj2[NSURLContentModificationDateKey]];
                                                                   }];
    
          // Delete files until we fall below our desired cache size.
          for (NSURL *fileURL in sortedFiles) {
              if ([_fileManager removeItemAtURL:fileURL error:nil]) {
                  NSDictionary<NSString *, id> *resourceValues = cacheFiles[fileURL];
                  NSNumber *totalAllocatedSize = resourceValues[NSURLTotalFileAllocatedSizeKey];
                  currentCacheSize -= totalAllocatedSize.unsignedIntegerValue;
    
                  if (currentCacheSize < desiredCacheSize) {
                      break;
                  }
              }
          }
      }
      if (completionBlock) {
          dispatch_async(dispatch_get_main_queue(), ^{
              completionBlock();
          });
      }
    

    });
    }

if SD_UIKIT

  • (void)backgroundDeleteOldFiles {
    Class UIApplicationClass = NSClassFromString(@"UIApplication");
    if(!UIApplicationClass || ![UIApplicationClass respondsToSelector:@selector(sharedApplication)]) {
    return;
    }
    UIApplication *application = [UIApplication performSelector:@selector(sharedApplication)];
    __block UIBackgroundTaskIdentifier bgTask = [application beginBackgroundTaskWithExpirationHandler:^{
    // Clean up any unfinished task business by marking where you
    // stopped or ending the task outright.
    [application endBackgroundTask:bgTask];
    bgTask = UIBackgroundTaskInvalid;
    }];

    // Start the long-running task and return immediately.
    [self deleteOldFilesWithCompletionBlock:^{
    [application endBackgroundTask:bgTask];
    bgTask = UIBackgroundTaskInvalid;
    }];
    }

endif

pragma mark - Cache Info

  • (NSUInteger)getSize {
    __block NSUInteger size = 0;
    dispatch_sync(self.ioQueue, ^{
    NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtPath:self.diskCachePath];
    for (NSString *fileName in fileEnumerator) {
    NSString *filePath = [self.diskCachePath stringByAppendingPathComponent:fileName];
    NSDictionary<NSString *, id> *attrs = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil];
    size += [attrs fileSize];
    }
    });
    return size;
    }

  • (NSUInteger)getDiskCount {
    __block NSUInteger count = 0;
    dispatch_sync(self.ioQueue, ^{
    NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtPath:self.diskCachePath];
    count = fileEnumerator.allObjects.count;
    });
    return count;
    }

  • (void)calculateSizeWithCompletionBlock:(nullable SDWebImageCalculateSizeBlock)completionBlock {
    NSURL *diskCacheURL = [NSURL fileURLWithPath:self.diskCachePath isDirectory:YES];

    dispatch_async(self.ioQueue, ^{
    NSUInteger fileCount = 0;
    NSUInteger totalSize = 0;

      NSDirectoryEnumerator *fileEnumerator = [_fileManager enumeratorAtURL:diskCacheURL
                                                 includingPropertiesForKeys:@[NSFileSize]
                                                                    options:NSDirectoryEnumerationSkipsHiddenFiles
                                                               errorHandler:NULL];
    
      for (NSURL *fileURL in fileEnumerator) {
          NSNumber *fileSize;
          [fileURL getResourceValue:&fileSize forKey:NSURLFileSizeKey error:NULL];
          totalSize += fileSize.unsignedIntegerValue;
          fileCount += 1;
      }
    
      if (completionBlock) {
          dispatch_async(dispatch_get_main_queue(), ^{
              completionBlock(fileCount, totalSize);
          });
      }
    

    });
    }

@end

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市莉钙,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖掏呼,帶你破解...
    沈念sama閱讀 216,591評(píng)論 6 501
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件遵绰,死亡現(xiàn)場(chǎng)離奇詭異计技,居然都是意外死亡,警方通過(guò)查閱死者的電腦和手機(jī)逛绵,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,448評(píng)論 3 392
  • 文/潘曉璐 我一進(jìn)店門怀各,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái),“玉大人术浪,你說(shuō)我怎么就攤上這事瓢对。” “怎么了胰苏?”我有些...
    開封第一講書人閱讀 162,823評(píng)論 0 353
  • 文/不壞的土叔 我叫張陵硕蛹,是天一觀的道長(zhǎng)。 經(jīng)常有香客問(wèn)我硕并,道長(zhǎng)法焰,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,204評(píng)論 1 292
  • 正文 為了忘掉前任倔毙,我火速辦了婚禮埃仪,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘陕赃。我一直安慰自己卵蛉,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,228評(píng)論 6 388
  • 文/花漫 我一把揭開白布么库。 她就那樣靜靜地躺著傻丝,像睡著了一般。 火紅的嫁衣襯著肌膚如雪廊散。 梳的紋絲不亂的頭發(fā)上桑滩,一...
    開封第一講書人閱讀 51,190評(píng)論 1 299
  • 那天,我揣著相機(jī)與錄音允睹,去河邊找鬼运准。 笑死,一個(gè)胖子當(dāng)著我的面吹牛缭受,可吹牛的內(nèi)容都是我干的胁澳。 我是一名探鬼主播,決...
    沈念sama閱讀 40,078評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼米者,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼韭畸!你這毒婦竟也來(lái)了?” 一聲冷哼從身側(cè)響起蔓搞,我...
    開封第一講書人閱讀 38,923評(píng)論 0 274
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤胰丁,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后喂分,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體锦庸,經(jīng)...
    沈念sama閱讀 45,334評(píng)論 1 310
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,550評(píng)論 2 333
  • 正文 我和宋清朗相戀三年蒲祈,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了甘萧。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片萝嘁。...
    茶點(diǎn)故事閱讀 39,727評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖扬卷,靈堂內(nèi)的尸體忽然破棺而出牙言,到底是詐尸還是另有隱情,我是刑警寧澤怪得,帶...
    沈念sama閱讀 35,428評(píng)論 5 343
  • 正文 年R本政府宣布咱枉,位于F島的核電站,受9級(jí)特大地震影響汇恤,放射性物質(zhì)發(fā)生泄漏庞钢。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,022評(píng)論 3 326
  • 文/蒙蒙 一因谎、第九天 我趴在偏房一處隱蔽的房頂上張望基括。 院中可真熱鬧,春花似錦财岔、人聲如沸风皿。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,672評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)桐款。三九已至,卻和暖如春夷恍,著一層夾襖步出監(jiān)牢的瞬間魔眨,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,826評(píng)論 1 269
  • 我被黑心中介騙來(lái)泰國(guó)打工酿雪, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留遏暴,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 47,734評(píng)論 2 368
  • 正文 我出身青樓指黎,卻偏偏與公主長(zhǎng)得像朋凉,于是被迫代替她去往敵國(guó)和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子醋安,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,619評(píng)論 2 354

推薦閱讀更多精彩內(nèi)容