Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
b2ff9dc3
Commit
b2ff9dc3
authored
Jan 28, 2011
by
Sam Lantinga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added API function to get CPU cache line size.
parent
b0a2a895
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
SDL_cpuinfo.h
include/SDL_cpuinfo.h
+8
-0
SDL_cpuinfo.c
src/cpuinfo/SDL_cpuinfo.c
+5
-5
No files found.
include/SDL_cpuinfo.h
View file @
b2ff9dc3
...
...
@@ -51,6 +51,14 @@ extern "C" {
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetCPUCount
(
void
);
/**
* This function returns the L1 cache line size of the CPU
*
* This is useful for determining multi-threaded structure padding
* or SIMD prefetch sizes.
*/
extern
DECLSPEC
int
SDLCALL
SDL_GetCPUCacheLineSize
(
void
);
/**
* This function returns true if the CPU has the RDTSC instruction.
*/
...
...
src/cpuinfo/SDL_cpuinfo.c
View file @
b2ff9dc3
...
...
@@ -304,7 +304,7 @@ CPU_haveAltiVec(void)
static
int
SDL_CPUCount
=
0
;
int
SDL_GetCPUCount
()
SDL_GetCPUCount
(
void
)
{
if
(
!
SDL_CPUCount
)
{
#if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN)
...
...
@@ -335,7 +335,7 @@ SDL_GetCPUCount()
/* Oh, such a sweet sweet trick, just not very useful. :) */
static
const
char
*
SDL_GetCPUType
()
SDL_GetCPUType
(
void
)
{
static
char
SDL_CPUType
[
13
];
...
...
@@ -366,7 +366,7 @@ SDL_GetCPUType()
}
static
const
char
*
SDL_GetCPUName
()
SDL_GetCPUName
(
void
)
{
static
char
SDL_CPUName
[
48
];
...
...
@@ -437,8 +437,8 @@ SDL_GetCPUName()
return
SDL_CPUName
;
}
static
int
SDL_GetCPUCacheLineSize
()
int
SDL_GetCPUCacheLineSize
(
void
)
{
const
char
*
cpuType
=
SDL_GetCPUType
();
...
...
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