refact: use DoricSingleton to hold all static or singleton objects

This commit is contained in:
pengfei.zhou
2021-07-21 17:56:03 +08:00
committed by osborn
parent 7d4d6713c6
commit 61c262bcc6
30 changed files with 320 additions and 221 deletions

View File

@@ -22,6 +22,7 @@
#import "DoricPerformanceProfile.h"
#import "DoricRegistry.h"
#import "DoricSingleton.h"
@interface DoricPerformanceProfile ()
@property(nonatomic, strong) dispatch_queue_t anchorQueue;
@@ -36,7 +37,7 @@ - (instancetype)initWithName:(NSString *)name {
_name = name;
_anchorQueue = dispatch_queue_create("doric.performance.profile", DISPATCH_QUEUE_SERIAL);
_anchorMap = [NSMutableDictionary new];
_enable = [DoricRegistry isEnablePerformance];
_enable = DoricSingleton.instance.enablePerformance;
_hooks = [NSHashTable new];
}
return self;