Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AndroidSystemCore
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Matombo
AndroidSystemCore
Commits
1def25a2
Commit
1def25a2
authored
May 28, 2015
by
Adam Lesinski
Browse files
Options
Downloads
Plain Diff
Merge commit '
7ac60686
' into manualmerge
Change-Id: I671a57d906ca6826722fb892627d235b14b822eb
parents
16092b7a
7ac60686
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
libcutils/native_handle.c
+8
-2
8 additions, 2 deletions
libcutils/native_handle.c
with
8 additions
and
2 deletions
libcutils/native_handle.c
+
8
−
2
View file @
1def25a2
...
...
@@ -25,11 +25,17 @@
#include
<cutils/log.h>
#include
<cutils/native_handle.h>
static
const
int
kMaxNativeFds
=
1024
;
static
const
int
kMaxNativeInts
=
1024
;
native_handle_t
*
native_handle_create
(
int
numFds
,
int
numInts
)
{
native_handle_t
*
h
=
malloc
(
sizeof
(
native_handle_t
)
+
sizeof
(
int
)
*
(
numFds
+
numInts
));
if
(
numFds
<
0
||
numInts
<
0
||
numFds
>
kMaxNativeFds
||
numInts
>
kMaxNativeInts
)
{
return
NULL
;
}
size_t
mallocSize
=
sizeof
(
native_handle_t
)
+
(
sizeof
(
int
)
*
(
numFds
+
numInts
));
native_handle_t
*
h
=
malloc
(
mallocSize
);
if
(
h
)
{
h
->
version
=
sizeof
(
native_handle_t
);
h
->
numFds
=
numFds
;
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment