新的 SDWebImageCache.m 解决内存增加很严重的问题

/*

  • 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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,456评论 5 477
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,370评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,337评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,583评论 1 273
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,596评论 5 365
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,572评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,936评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,595评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,850评论 1 297
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,601评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,685评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,371评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,951评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,934评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,167评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 43,636评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,411评论 2 342

推荐阅读更多精彩内容