Changeset 247900 in webkit for trunk/Source/JavaScriptCore/heap/HeapCell.h
- Timestamp:
- Jul 28, 2019, 9:31:04 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/heap/HeapCell.h
r247886 r247900 1 1 /* 2 * Copyright (C) 2016-201 9Apple Inc. All rights reserved.2 * Copyright (C) 2016-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 48 48 HeapCell() { } 49 49 50 // We're intentionally only zapping the bits for the structureID and leaving 51 // the rest of the cell header bits intact for crash analysis uses. 52 enum ZapReason : int8_t { Unspecified, Destruction, StopAllocating }; 53 void zap(ZapReason reason) 54 { 55 uint32_t* cellWords = bitwise_cast<uint32_t*>(this); 56 cellWords[0] = 0; 57 // Leaving cellWords[1] alone for crash analysis if needed. 58 cellWords[2] = reason; 59 } 60 bool isZapped() const { return !*bitwise_cast<const uint32_t*>(this); } 50 void zap() { *reinterpret_cast_ptr<uintptr_t**>(this) = 0; } 51 bool isZapped() const { return !*reinterpret_cast_ptr<uintptr_t* const*>(this); } 61 52 62 53 bool isLive();
Note:
See TracChangeset
for help on using the changeset viewer.