Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
2011fd9a
Commit
2011fd9a
authored
Jun 29, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlc_GetCPUCount: use counting functions instead of loop
parent
497f9aff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
13 deletions
+2
-13
src/posix/thread.c
src/posix/thread.c
+1
-4
src/win32/thread.c
src/win32/thread.c
+1
-9
No files found.
src/posix/thread.c
View file @
2011fd9a
...
...
@@ -1038,10 +1038,7 @@ unsigned vlc_GetCPUCount(void)
if
(
sched_getaffinity
(
getpid
(),
sizeof
(
cpu
),
&
cpu
)
<
0
)
return
1
;
unsigned
count
=
0
;
for
(
unsigned
i
=
0
;
i
<
CPU_SETSIZE
;
i
++
)
count
+=
CPU_ISSET
(
i
,
&
cpu
)
!=
0
;
return
count
;
return
CPU_COUNT
(
&
cpu
);
#elif defined(__APPLE__)
int
count
;
...
...
src/win32/thread.c
View file @
2011fd9a
...
...
@@ -916,15 +916,7 @@ unsigned vlc_GetCPUCount (void)
DWORD
system
;
if
(
GetProcessAffinityMask
(
GetCurrentProcess
(),
&
process
,
&
system
))
{
unsigned
count
=
0
;
while
(
system
)
{
count
++
;
system
>>=
1
;
}
return
count
;
}
return
popcount
(
system
);
#endif
return
1
;
}
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