weak實現原理

平時開發中我們經常會用到weak,但是它的實現原理也許不是很清楚,今天就從源碼來探究一下(weak實現原理源碼鏈接)。

weak指針的建立

weak修飾對象不增加其引用計數,系統通過一個hash表來實現對象的弱引用。
在Xcode下編寫如下代碼:
__weak obj1 = obj;
編譯器編譯之后變成類似如下的代碼:
objc_initWeak(&obj1,obj);
翻開runtime源碼,NSObject.mm,找到objc_initWeak函數,實現如下:

// jack.deng weak實現原理
id
objc_initWeak(id *location, id newObj)
{
    if (!newObj) {
        *location = nil;
        return nil;
    }

    return storeWeak<DontHaveOld, DoHaveNew, DoCrashIfDeallocating>
        (location, (objc_object*)newObj);
}

apple對參數已有說明,location是weak指針的地址,newObj是被指向的對象的地址。接下來尋找storeWeak函數,先看apple對storeWeak函數的注釋:

// Update a weak variable.
// If HaveOld is true, the variable has an existing value 
//   that needs to be cleaned up. This value might be nil.
// If HaveNew is true, there is a new value that needs to be 
//   assigned into the variable. This value might be nil.
// If CrashIfDeallocating is true, the process is halted if newObj is 
//   deallocating or newObj's class does not support weak references. 
//   If CrashIfDeallocating is false, nil is stored instead.

如果weak指針有指向的對象,那么清除這個對象,然后weak指針指向新的對象;如果weak指針指向新的對象,那么就將新的weak引用存起來;如果weak指針指向的對象被釋放了,那么就不會存儲這個weak引用,直接返回nil。下面一行行看代碼:

weak實現原理關鍵方法

打開NSObject.mm查看storeWeak(id *location, objc_object *newObj)方法實現。

// jack.deng weak實現原理關鍵方法     //[我已經配了中英文雙語解釋了]
// HaveOld:  true - 變量有值
//          false - 需要被及時清理,當前值可能為 nil
// HaveNew:  true - 需要被分配的新值,當前值可能為 nil
//          false - 不需要分配新值
// CrashIfDeallocating: true - 說明 newObj 已經釋放或者 newObj 不支持弱引用,該過程需要暫停
//          false - 用 nil 替代存儲

// 大家可能看不懂template,我簡單解釋一下,這是c++的模板函數:  
// 模板(Template)指C++程序設計設計語言中采用類型作為參數的程序設計,支持通用程序設計。簡單來說就是支持多種類型。
// 我們這里可以認為這個storeWeak函數有5個參數就可以了
template <HaveOld haveOld, HaveNew haveNew,
          CrashIfDeallocating crashIfDeallocating>
static id 
storeWeak(id *location, objc_object *newObj)
{
    assert(haveOld  ||  haveNew);
    if (!haveNew) assert(newObj == nil);

    // 該過程用來更新弱引用指針的指向
    // 初始化 previouslyInitializedClass 指針
    Class previouslyInitializedClass = nil;
    id oldObj;
    // 聲明兩個 SideTable
    SideTable *oldTable;
    SideTable *newTable;

    // Acquire locks for old and new values.
    // Order by lock address to prevent lock ordering problems. 
    // Retry if the old value changes underneath us.
    // 獲得新值和舊值的鎖存位置(用地址作為唯一標示)
    // 通過地址來建立索引標志,防止重復
    // 下面指向的操作會改變舊值
 retry:
    if (haveOld) {
        // 更改指針,獲得以 oldObj 為索引所存儲的值地址
        oldObj = *location;
        oldTable = &SideTables()[oldObj];
    } else {
        oldTable = nil;
    }
    if (haveNew) {
        // 更改新值指針,獲得以 newObj 為索引所存儲的值地址
        newTable = &SideTables()[newObj];
    } else {
        newTable = nil;
    }

     // 加鎖操作,防止多線程中競爭沖突
    SideTable::lockTwo<haveOld, haveNew>(oldTable, newTable);
    // 避免線程沖突重處理
    // location 應該與 oldObj 保持一致,如果不同,說明當前的 location 已經處理過 oldObj 可是又被其他線程所修改
    if (haveOld  &&  *location != oldObj) {
        SideTable::unlockTwo<haveOld, haveNew>(oldTable, newTable);
        goto retry;
    }

    // Prevent a deadlock between the weak reference machinery
    // and the +initialize machinery by ensuring that no 
    // weakly-referenced object has an un-+initialized isa.
    // 防止弱引用間死鎖
    // 并且通過 +initialize 初始化構造器保證所有弱引用的 isa 非空指向
    if (haveNew  &&  newObj) {
        // 獲得新對象的 isa 指針
        Class cls = newObj->getIsa();
        // 判斷 isa 非空且已經初始化
        if (cls != previouslyInitializedClass  &&  
            !((objc_class *)cls)->isInitialized()) 
        {
            // 解鎖
            SideTable::unlockTwo<haveOld, haveNew>(oldTable, newTable);
            // 對其 isa 指針進行初始化
            _class_initialize(_class_getNonMetaClass(cls, (id)newObj));

            // If this class is finished with +initialize then we're good.
            // If this class is still running +initialize on this thread 
            // (i.e. +initialize called storeWeak on an instance of itself)
            // then we may proceed but it will appear initializing and 
            // not yet initialized to the check above.
            // Instead set previouslyInitializedClass to recognize it on retry.
            // 如果該類已經完成執行 +initialize 方法是最理想情況
            // 如果該類 +initialize 在線程中
            // 例如 +initialize 正在調用 storeWeak 方法
            // 需要手動對其增加保護策略,并設置 previouslyInitializedClass 指針進行標記
            previouslyInitializedClass = cls;

            goto retry;
        }
    }

    // Clean up old value, if any.
    // 清除舊值
    if (haveOld) {
        weak_unregister_no_lock(&oldTable->weak_table, oldObj, location);
    }

    // Assign new value, if any.
    // 分配新值
    if (haveNew) {
        newObj = (objc_object *)
            weak_register_no_lock(&newTable->weak_table, (id)newObj, location, 
                                  crashIfDeallocating);
        // 如果弱引用被釋放 weak_register_no_lock 方法返回 nil
        // 在引用計數表中設置若引用標記位
        // weak_register_no_lock returns nil if weak store should be rejected

        // Set is-weakly-referenced bit in refcount table.
        if (newObj  &&  !newObj->isTaggedPointer()) {
            // 弱引用位初始化操作
            // 引用計數那張散列表的weak引用對象的引用計數中標識為weak引用
            newObj->setWeaklyReferenced_nolock();
        }

        // Do not set *location anywhere else. That would introduce a race.
        // 之前不要設置 location 對象,這里需要更改指針指向
        *location = (id)newObj;
    }
    else {
        // No new value. The storage is not changed.
        // 沒有新值,則無需更改
    }
    
    SideTable::unlockTwo<haveOld, haveNew>(oldTable, newTable);

    return (id)newObj;
}

這里面用到了SideTable,我們看看它到底是啥

SideTable

打開NSObject.mm查看struct SideTable {

struct SideTable {
    spinlock_t slock;  // 防止競爭的自旋鎖
    RefcountMap refcnts; // 引用計數的 hash 表
    weak_table_t weak_table;  // weak 引用全局 hash 表

    SideTable() {
        memset(&weak_table, 0, sizeof(weak_table));
    }

    ~SideTable() {
        _objc_fatal("Do not delete SideTable.");
    }

    void lock() { slock.lock(); }
    void unlock() { slock.unlock(); }
    void forceReset() { slock.forceReset(); }

    // Address-ordered lock discipline for a pair of side tables.

    template<HaveOld, HaveNew>
    static void lockTwo(SideTable *lock1, SideTable *lock2);
    template<HaveOld, HaveNew>
    static void unlockTwo(SideTable *lock1, SideTable *lock2);
};

對于 slock 和 refcnts 兩個成員不用多說,第一個是為了防止競爭選擇的自旋鎖,第二個是協助對象的 isa 指針的 extra_rc 共同引用計數的變量。這里主要看 weak 全局 hash 表的結構與作用。

weak表

weak表是一個弱引用表,實現為一個weak_table_t結構體,存儲了某個對象相關的的所有的弱引用信息。其定義如下(見objc-weak.h中的struct weak_table_t {定義)

struct weak_table_t {
    // 保存了所有指向指定對象的 weak 指針
    weak_entry_t *weak_entries;
    // 存儲空間
    size_t    num_entries;
    // 參與判斷引用計數輔助量
    uintptr_t mask;
    // hash key 最大偏移值
    uintptr_t max_hash_displacement;
};

這是一個全局弱引用hash表。使用不定類型對象的地址作為 key ,用 weak_entry_t 類型結構體對象作為 value 。其中的 weak_entries成員,從字面意思上看,即為弱引用表入口。其實現也是這樣的。
其中weak_entry_t是存儲在弱引用表中的一個內部結構體,它負責維護和存儲指向一個對象的所有弱引用hash表。其定義如下:

#define WEAK_INLINE_COUNT 4
#define REFERRERS_OUT_OF_LINE 2
struct weak_entry_t {
    DisguisedPtr<objc_object> referent;
    union {
        struct {
            weak_referrer_t *referrers;
            uintptr_t        out_of_line_ness : 2;
            uintptr_t        num_refs : PTR_MINUS_2;
            uintptr_t        mask;
            uintptr_t        max_hash_displacement;
        };
        struct {
            // out_of_line_ness field is low bits of inline_referrers[1]
            weak_referrer_t  inline_referrers[WEAK_INLINE_COUNT];
        };
    };

    bool out_of_line() {
        return (out_of_line_ness == REFERRERS_OUT_OF_LINE);
    }

    weak_entry_t& operator=(const weak_entry_t& other) {
        memcpy(this, &other, sizeof(other));
        return *this;
    }

    weak_entry_t(objc_object *newReferent, objc_object **newReferrer)
        : referent(newReferent)
    {
        inline_referrers[0] = newReferrer;
        for (int i = 1; i < WEAK_INLINE_COUNT; i++) {
            inline_referrers[i] = nil;
        }
    }
};

在 weak_entry_t 的結構中,DisguisedPtr referent 是對泛型對象的指針做了一個封裝,通過這個泛型類來解決內存泄漏的問題。從注釋中寫 out_of_line 成員為最低有效位,當其為0的時候, weak_referrer_t 成員將擴展為多行靜態 hash table。其實其中的 weak_referrer_t 是二維 objc_object 的別名,通過一個二維指針地址偏移,用下標作為 hash 的 key,做成了一個弱引用散列。
那么在有效位未生效的時候,out_of_line 、 num_refs、 mask 、 max_hash_displacement 有什么作用?以下是筆者自身的猜測:
out_of_line:最低有效位,也是標志位。當標志位 0 時,增加引用表指針緯度。
num_refs:引用數值。這里記錄弱引用表中引用有效數字,因為弱引用表使用的是靜態 hash 結構,所以需要使用變量來記錄數目。
mask:計數輔助量。
max_hash_displacement:hash 元素上限閥值。
其實 out_of_line 的值通常情況下是等于零的,所以弱引用表總是一個 objc_objective 指針二維數組。一維 objc_objective 指針可構成一張弱引用散列表,通過第三緯度實現了多張散列表,并且表數量為 WEAK_INLINE_COUNT 。

總結一下 StripedMap[] : StripedMap 是一個模板類,在這個類中有一個 array 成員,用來存儲 PaddedT 對象,并且其中對于 [] 符的重載定義中,會返回這個 PaddedT 的 value 成員,這個 value 就是我們傳入的 T 泛型成員,也就是 SideTable 對象。在 array 的下標中,這里使用了 indexForPointer 方法通過位運算計算下標,實現了靜態的 Hash Table。而在 weak_table 中,其成員 weak_entry 會將傳入對象的地址加以封裝起來,并且其中也有訪問全局弱引用表的入口。


SideTable結構

下面再說說2個主要方法

舊對象解除注冊操作 weak_unregister_no_lock

該方法主要作用是將舊對象在 weak_table 中解除 weak 指針的對應綁定。根據函數名,稱之為解除注冊操作。從源碼中,可以知道其功能就是從 weak_table 中解除 weak 指針的綁定。而其中的遍歷查詢,就是針對于 weak_entry 中的多張弱引用散列表。(見obcj-weak.mm中的weak_unregister_no_lock)

void
weak_unregister_no_lock(weak_table_t *weak_table, id referent_id, 
                        id *referrer_id)
{
    objc_object *referent = (objc_object *)referent_id;
    objc_object **referrer = (objc_object **)referrer_id;

    weak_entry_t *entry;

    if (!referent) return;

    if ((entry = weak_entry_for_referent(weak_table, referent))) {
        remove_referrer(entry, referrer);
        bool empty = true;
        if (entry->out_of_line()  &&  entry->num_refs != 0) {
            empty = false;
        }
        else {
            for (size_t i = 0; i < WEAK_INLINE_COUNT; i++) {
                if (entry->inline_referrers[i]) {
                    empty = false; 
                    break;
                }
            }
        }

        if (empty) {
            weak_entry_remove(weak_table, entry);
        }
    }

    // Do not set *referrer = nil. objc_storeWeak() requires that the 
    // value not change.
}
新對象添加注冊操作 weak_register_no_lock

這一步與上一步相反,通過 weak_register_no_lock 函數把心的對象進行注冊操作,完成與對應的弱引用表進行綁定操作。(見obcj-weak.mm中的weak_register_no_lock)

id 
weak_register_no_lock(weak_table_t *weak_table, id referent_id, 
                      id *referrer_id, bool crashIfDeallocating)
{
    objc_object *referent = (objc_object *)referent_id;
    objc_object **referrer = (objc_object **)referrer_id;

    if (!referent  ||  referent->isTaggedPointer()) return referent_id;

    // ensure that the referenced object is viable
    bool deallocating;
    if (!referent->ISA()->hasCustomRR()) {
        deallocating = referent->rootIsDeallocating();
    }
    else {
        BOOL (*allowsWeakReference)(objc_object *, SEL) = 
            (BOOL(*)(objc_object *, SEL))
            object_getMethodImplementation((id)referent, 
                                           SEL_allowsWeakReference);
        if ((IMP)allowsWeakReference == _objc_msgForward) {
            return nil;
        }
        deallocating =
            ! (*allowsWeakReference)(referent, SEL_allowsWeakReference);
    }

    if (deallocating) {
        if (crashIfDeallocating) {
            _objc_fatal("Cannot form weak reference to instance (%p) of "
                        "class %s. It is possible that this object was "
                        "over-released, or is in the process of deallocation.",
                        (void*)referent, object_getClassName((id)referent));
        } else {
            return nil;
        }
    }

    // now remember it and where it is being stored
    weak_entry_t *entry;
    if ((entry = weak_entry_for_referent(weak_table, referent))) {
        append_referrer(entry, referrer);
    } 
    else {
        weak_entry_t new_entry(referent, referrer);
        weak_grow_maybe(weak_table);
        weak_entry_insert(weak_table, &new_entry);
    }

    // Do not set *referrer. objc_storeWeak() requires that the 
    // value not change.

    return referent_id;
}
初始化弱引用對象流程一覽

弱引用的初始化,從上文的分析中可以看出,主要的操作部分就在弱引用表的取鍵、查詢散列、創建弱引用表等操作,可以總結出如下的流程圖:


初始化弱引用流程圖

這個圖中省略了很多情況的判斷,但是當聲明一個 __weak 會調用上圖中的這些方法。當然, storeWeak 方法不僅僅用在 __weak 的聲明中,在 class 內部的操作中也會常常通過該方法來對 weak 對象進行操作。

weak指針的銷毀

weak指針的建立說完了,我們再來看看它的銷毀。
再來看weak是在什么時候銷毀并被置為空的。找到dealloc函數的實現,其中dealloc主要調用了objc_destructInstance函數:

// dealloc調用_objc_rootDealloc
- (void)dealloc {
    _objc_rootDealloc(self);
}
// _objc_rootDealloc調用obj->rootDealloc()
void
_objc_rootDealloc(id obj)
{
    assert(obj);

    obj->rootDealloc();
}

inline void
objc_object::rootDealloc()
{
    if (isTaggedPointer()) return;  // fixme necessary?

    if (fastpath(isa.nonpointer  &&  
                 !isa.weakly_referenced  &&  
                 !isa.has_assoc  &&  
                 !isa.has_cxx_dtor  &&  
                 !isa.has_sidetable_rc))
    {
        assert(!sidetable_present());
        free(this);
    } 
    else {
        object_dispose((id)this);
    }
}

id 
object_dispose(id obj)
{
    if (!obj) return nil;

    objc_destructInstance(obj);    
    free(obj);

    return nil;
}
void *objc_destructInstance(id obj) 
{
    if (obj) {
        // Read all of the flags at once for performance.
        bool cxx = obj->hasCxxDtor();
        bool assoc = obj->hasAssociatedObjects();

        // This order is important.
// 尋找一個名為 ._cxx_destruct 的函數,這一步主要是由編譯器插入代碼實現,這里銷毀了對象的實例變量,并且調用了父類的dealloc(ARC環境下)
        if (cxx) object_cxxDestruct(obj); 
// 調用_object_remove_assocations函數清除對象的所有關聯對象。
        if (assoc) _object_remove_assocations(obj);
// 調用obj->clearDeallocating()函數清除所有的weak指針被將其置為nil。
        obj->clearDeallocating();
    }

    return obj;
}
inline void 
objc_object::clearDeallocating()
{
    if (slowpath(!isa.nonpointer)) {
        // Slow path for raw pointer isa.
        sidetable_clearDeallocating();
    }
    else if (slowpath(isa.weakly_referenced  ||  isa.has_sidetable_rc)) {
        // Slow path for non-pointer isa with weak refs and/or side table data.
        clearDeallocating_slow();
    }
    assert(!sidetable_present());
}
void 
objc_object::sidetable_clearDeallocating()
{
    SideTable& table = SideTables()[this];

    // clear any weak table items
    // clear extra retain count and deallocating bit
    // (fixme warn or abort if extra retain count == 0 ?)
    table.lock();
    RefcountMap::iterator it = table.refcnts.find(this);
    if (it != table.refcnts.end()) {
        if (it->second & SIDE_TABLE_WEAKLY_REFERENCED) {
            weak_clear_no_lock(&table.weak_table, (id)this);
        }
        table.refcnts.erase(it);
    }
    table.unlock();
}
NEVER_INLINE void
objc_object::clearDeallocating_slow()
{
    assert(isa.nonpointer  &&  (isa.weakly_referenced || isa.has_sidetable_rc));

    SideTable& table = SideTables()[this];
    table.lock();
    if (isa.weakly_referenced) {
        weak_clear_no_lock(&table.weak_table, (id)this);
    }
    if (isa.has_sidetable_rc) {
        table.refcnts.erase(this);
    }
    table.unlock();
}

從上面的調用順序可以看出

  1. dealloc調用_objc_rootDealloc調用objc_object::rootDealloc()
  2. objc_object::rootDealloc()調用object_dispose
  3. object_dispose調用objc_destructInstance
  4. objc_destructInstance調用obj->clearDeallocating()
  5. clearDeallocating里面有分支sidetable_clearDeallocating()和clearDeallocating_slow(),但是這2個函數里面其實都是調用了weak_clear_no_lock。 所以我們來看看weak_clear_no_lock
核心方法weak_clear_no_lock
void 
weak_clear_no_lock(weak_table_t *weak_table, id referent_id) 
{
   //1、拿到被銷毀對象的指針
    objc_object *referent = (objc_object *)referent_id;
    //2、通過 指針 在weak_table中查找出對應的entry
    weak_entry_t *entry = weak_entry_for_referent(weak_table, referent);
    if (entry == nil) {
        /// XXX shouldn't happen, but does with mismatched CF/objc
        //printf("XXX no entry for clear deallocating %p\n", referent);
        return;
    }
     //3、將所有的引用設置成nil
    // zero out references
    weak_referrer_t *referrers;
    size_t count;
    
    if (entry->out_of_line()) {
        //3.1、如果弱引用超過4個則將referrers數組內的弱引用都置成nil。
        referrers = entry->referrers;
        count = TABLE_SIZE(entry);
    } 
    else {
       //3.2、不超過4個則將inline_referrers數組內的弱引用都置成nil
        referrers = entry->inline_referrers;
        count = WEAK_INLINE_COUNT;
    }
      //循環設置所有的引用為nil
    for (size_t i = 0; i < count; ++i) {
        objc_object **referrer = referrers[i];
        if (referrer) {
            if (*referrer == referent) {
                *referrer = nil;
            }
            else if (*referrer) {
                _objc_inform("__weak variable at %p holds %p instead of %p. "
                             "This is probably incorrect use of "
                             "objc_storeWeak() and objc_loadWeak(). "
                             "Break on objc_weak_error to debug.\n", 
                             referrer, (void*)*referrer, (void*)referent);
                objc_weak_error();
            }
        }
    }
      //4、從weak_table中移除entry
    weak_entry_remove(weak_table, entry);
}

該函數的做了如下事情:

  1. 從weak表中獲取廢棄對象的地址為鍵值的記錄
  2. 將包含在記錄中的所有附有 weak修飾符變量的地址,賦值為nil
  3. 將weak表中該記錄刪除
  4. 從引用計數表中刪除廢棄對象的地址為鍵值的記錄

總結

嫌上面的內容太多,那就看簡化版
runtime維護了一個weak表,用于存儲指向某個對象的所有weak指針。weak表其實是一個hash(哈希)表,key是所指對象的地址,Value是weak指針的地址(這個地址的值是所指對象指針的地址)數組。

稍微詳細版

  1. 初始化時:runtime會調用objc_initWeak函數,初始化一個新的weak指針指向對象的地址。
  2. 添加引用時:objc_initWeak函數會調用 storeWeak() 函數, storeWeak() 的作用是更新指針指向,創建對應的弱引用表。
  3. 釋放時,調用clearDeallocating函數。clearDeallocating函數首先根據對象地址獲取所有weak指針地址的數組,然后遍歷這個數組把其中的數據設為nil,最后把這個entry從weak表中刪除,最后清理對象的記錄。
小尾巴

大家可能看了這篇文章還是暈乎乎的,主要是對里面的數據結構不是很清楚,我又找到2篇很好的文章,看完這個,保管完全不會暈乎乎了。
iOS管理對象內存的數據結構以及操作算法--SideTables、RefcountMap、weak_table_t-一
iOS管理對象內存的數據結構以及操作算法--SideTables、RefcountMap、weak_table_t-二

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市,隨后出現的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 229,460評論 6 538
  • 序言:濱河連續發生了三起死亡事件,死亡現場離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機,發現死者居然都...
    沈念sama閱讀 99,067評論 3 423
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事。” “怎么了?”我有些...
    開封第一講書人閱讀 177,467評論 0 382
  • 文/不壞的土叔 我叫張陵,是天一觀的道長。 經常有香客問我,道長,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 63,468評論 1 316
  • 正文 為了忘掉前任,我火速辦了婚禮,結果婚禮上,老公的妹妹穿的比我還像新娘。我一直安慰自己,他們只是感情好,可當我...
    茶點故事閱讀 72,184評論 6 410
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發上,一...
    開封第一講書人閱讀 55,582評論 1 325
  • 那天,我揣著相機與錄音,去河邊找鬼。 笑死,一個胖子當著我的面吹牛,可吹牛的內容都是我干的。 我是一名探鬼主播,決...
    沈念sama閱讀 43,616評論 3 444
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側響起,我...
    開封第一講書人閱讀 42,794評論 0 289
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后,有當地人在樹林里發現了一具尸體,經...
    沈念sama閱讀 49,343評論 1 335
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 41,096評論 3 356
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發現自己被綠了。 大學時的朋友給我發了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 43,291評論 1 371
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖,靈堂內的尸體忽然破棺而出,到底是詐尸還是另有隱情,我是刑警寧澤,帶...
    沈念sama閱讀 38,863評論 5 362
  • 正文 年R本政府宣布,位于F島的核電站,受9級特大地震影響,放射性物質發生泄漏。R本人自食惡果不足惜,卻給世界環境...
    茶點故事閱讀 44,513評論 3 348
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧,春花似錦、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 34,941評論 0 28
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至,卻和暖如春,著一層夾襖步出監牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 36,190評論 1 291
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人。 一個月前我還...
    沈念sama閱讀 52,026評論 3 396
  • 正文 我出身青樓,卻偏偏與公主長得像,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 48,253評論 2 375

推薦閱讀更多精彩內容