OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_COCOA_NSOBJECT_ZOMBIE_H_ |
| 6 #define CHROME_BROWSER_COCOA_NSOBJECT_ZOMBIE_H_ |
| 7 |
| 8 #import <Foundation/Foundation.h> |
| 9 |
| 10 // You should think twice every single time you use anything from this |
| 11 // namespace. |
| 12 namespace ObjcEvilDoers { |
| 13 |
| 14 // Enable zombies. Returns NO if it fails to enable. |
| 15 // |
| 16 // When |zombieAllObjects| is YES, all objects inheriting from |
| 17 // NSObject become zombies on -dealloc. If NO, -shouldBecomeCrZombie |
| 18 // is queried to determine whether to make the object a zombie. |
| 19 // |
| 20 // |zombieCount| controls how many zombies to store before freeing the |
| 21 // oldest. Set to 0 to free objects immediately after making them |
| 22 // zombies. |
| 23 BOOL ZombieEnable(BOOL zombieAllObjects, size_t zombieCount); |
| 24 |
| 25 // Disable zombies. |
| 26 void ZombieDisable(); |
| 27 |
| 28 } // namespace ObjcEvilDoers |
| 29 |
| 30 @interface NSObject (CrZombie) |
| 31 - (BOOL)shouldBecomeCrZombie; |
| 32 @end |
| 33 |
| 34 #endif // CHROME_BROWSER_COCOA_NSOBJECT_ZOMBIE_H_ |
OLD | NEW |