Last active
April 25, 2020 16:40
-
-
Save sophiawisdom/3f8e2459b7246abd64f798f41743f091 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sophiawisdom@Sophias-MacBook-Pro tweaks % ./test_release | |
namesCount before is 10 | |
namesCount after is 10 | |
sophiawisdom@Sophias-MacBook-Pro tweaks % |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <mach/mach_traps.h> | |
#include <mach/mach_types.h> | |
#include <mach/port.h> | |
int main() { | |
mach_port_name_array_t names; | |
int namesCount; | |
mach_port_type_array_t types; | |
int typesCount; | |
mach_port_names(mach_task_self(), &names, &namesCount, &types, &typesCount); | |
printf("namesCount before is %d\n", namesCount); | |
for (int i = 0; i < 1000; i++) { | |
int k = mach_thread_self(); | |
int j = task_self_trap(); | |
} | |
int newCount; | |
mach_port_names(mach_task_self(), &names, &newCount, &types, &typesCount); | |
printf("namesCount after is %d\n", namesCount); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment