Skip to content

Instantly share code, notes, and snippets.

@michaeleisel
Created November 22, 2018 04:15
Show Gist options
  • Save michaeleisel/fbf83bcea35c5f974fa579022e2a9b62 to your computer and use it in GitHub Desktop.
Save michaeleisel/fbf83bcea35c5f974fa579022e2a9b62 to your computer and use it in GitHub Desktop.
static dispatch_source_t msp;
static void func() {
msp = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYPRESSURE, NULL, DISPATCH_MEMORYPRESSURE_CRITICAL, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0));
dispatch_source_set_event_handler(msp, ^{
unsigned long l = dispatch_source_get_data(msp);
NSLog@"%@", @(l));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment