Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
14c5c608
Commit
14c5c608
authored
May 29, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve excessive rapid root access performance
parent
70a80090
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
2 deletions
+71
-2
Android.mk
jni/Android.mk
+2
-1
su
jni/su
+1
-1
list.c
jni/utils/list.c
+38
-0
list.h
jni/utils/list.h
+30
-0
No files found.
jni/Android.mk
View file @
14c5c608
...
...
@@ -19,6 +19,7 @@ LOCAL_SRC_FILES := \
utils/misc.c \
utils/vector.c \
utils/xwrap.c \
utils/list.c \
daemon/daemon.c \
daemon/socket_trans.c \
daemon/log_monitor.c \
...
...
@@ -40,7 +41,7 @@ LOCAL_SRC_FILES := \
su/db.c \
su/misc.c \
su/pts.c \
su/su_
client
.c \
su/su_
daemon
.c \
su/su_socket.c
LOCAL_CFLAGS := -Wno-implicit-exception-spec-mismatch
...
...
su
@
4f570658
Subproject commit
34fede71678201a0c7a7183d3ac0f8777f9238b2
Subproject commit
4f570658cce06f5b07edb8cc4c2cd0f900bfec11
jni/utils/list.c
0 → 100644
View file @
14c5c608
/* list.h - Double link list implementation
*/
#include <stdlib.h>
#include <string.h>
#include "list.h"
void
init_list_head
(
struct
list_head
*
head
)
{
head
->
next
=
head
;
head
->
prev
=
head
;
}
void
list_insert
(
struct
list_head
*
pos
,
struct
list_head
*
node
)
{
// First construct our new node
node
->
next
=
pos
->
next
;
node
->
prev
=
pos
;
// Maintain the list
pos
->
next
->
prev
=
node
;
pos
->
next
=
node
;
}
void
list_insert_end
(
struct
list_head
*
head
,
struct
list_head
*
node
)
{
list_insert
(
head
->
prev
,
node
);
}
void
list_pop
(
struct
list_head
*
pos
)
{
// Maintain the list
pos
->
prev
->
next
=
pos
->
next
;
pos
->
next
->
prev
=
pos
->
prev
;
// Remove references
pos
->
next
=
pos
;
pos
->
prev
=
pos
;
}
void
list_pop_end
(
struct
list_head
*
head
)
{
return
list_pop
(
head
->
prev
);
}
jni/utils/list.h
0 → 100644
View file @
14c5c608
/* list.h - Double link list implementation
*/
#ifndef _LIST_H_
#define _LIST_H_
#include <stddef.h>
struct
list_head
{
struct
list_head
*
next
;
struct
list_head
*
prev
;
};
void
init_list_head
(
struct
list_head
*
head
);
void
list_insert
(
struct
list_head
*
pos
,
struct
list_head
*
node
);
void
list_insert_end
(
struct
list_head
*
head
,
struct
list_head
*
node
);
void
list_pop
(
struct
list_head
*
pos
);
void
list_pop_end
(
struct
list_head
*
head
);
#define list_entry(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
#define list_for_each(pos, head) \
for (pos = (head)->next; pos != (head); pos = pos->next)
#define list_for_each_r(pos, head) \
for (pos = (head)->prev; pos != (head); pos = pos->prev)
#endif
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment