Use our own function to parse int

This commit is contained in:
topjohnwu
2019-03-07 20:31:35 -05:00
parent bbe4b69c8d
commit d2cb638fcd
6 changed files with 29 additions and 22 deletions

View File

@@ -38,21 +38,6 @@ void clean_magisk_props();
void crawl_procfs(const std::function<bool (int)> &fn);
bool proc_name_match(int pid, const char *name);
/*
* Bionic's atoi runs through strtol().
* Use our own implementation for faster conversion.
*/
static inline int parse_int(const char *s) {
int val = 0;
char c;
while ((c = *(s++))) {
if (c > '9' || c < '0')
return -1;
val = val * 10 + c - '0';
}
return val;
}
extern pthread_t proc_monitor_thread;
extern bool hide_enabled;
extern pthread_mutex_t monitor_lock;