Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why do you detect self == MMKV.class in initialize ? #41

Closed
SeanChense opened this issue Sep 27, 2018 · 1 comment
Closed

Why do you detect self == MMKV.class in initialize ? #41

SeanChense opened this issue Sep 27, 2018 · 1 comment

Comments

@SeanChense
Copy link

+ (void)initialize {
	if (self == MMKV.class) {
		static dispatch_once_t onceToken;
		dispatch_once(&onceToken, ^{
			g_instanceDic = [NSMutableDictionary dictionary];
			g_instanceLock = [[NSRecursiveLock alloc] init];

			MMKVInfo(@"pagesize:%d", DEFAULT_MMAP_SIZE);
		});
	}
}
@lingol
Copy link
Collaborator

lingol commented Sep 27, 2018

Nothing special, just something you should do when programming in Objective-C. initialize().

@lingol lingol closed this as completed Sep 27, 2018
@sven-brobonds sven-brobonds mentioned this issue Jul 21, 2020
This was referenced Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants