Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
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
Chen Yisong
lxc
Commits
fd63cb7c
Unverified
Commit
fd63cb7c
authored
Sep 26, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: add __hot attribute
This instructs the compiler to better optimize the config parsing code. Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
0b35ed87
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
7 deletions
+14
-7
compiler.h
src/lxc/compiler.h
+4
-0
confile.c
src/lxc/confile.c
+4
-3
parse.h
src/lxc/parse.h
+6
-4
No files found.
src/lxc/compiler.h
View file @
fd63cb7c
...
@@ -54,6 +54,10 @@
...
@@ -54,6 +54,10 @@
# endif
# endif
#endif
#endif
#ifndef __hot
# define __hot __attribute__((hot))
#endif
#define __cgfsng_ops
#define __cgfsng_ops
#endif
/* __LXC_COMPILER_H */
#endif
/* __LXC_COMPILER_H */
src/lxc/confile.c
View file @
fd63cb7c
...
@@ -71,11 +71,12 @@
...
@@ -71,11 +71,12 @@
lxc_log_define
(
confile
,
lxc
);
lxc_log_define
(
confile
,
lxc
);
#define lxc_config_define(name) \
#define lxc_config_define(name) \
static int set_config_##name(const char *, const char *,
\
__hot static int set_config_##name(const char *, const char *,
\
struct lxc_conf *, void *); \
struct lxc_conf *, void *); \
static int get_config_##name(const char *, char *, int,
\
__hot static int get_config_##name(const char *, char *, int,
\
struct lxc_conf *, void *); \
struct lxc_conf *, void *); \
static int clr_config_##name(const char *, struct lxc_conf *, void *);
__hot static int clr_config_##name(const char *, struct lxc_conf *, \
void *);
lxc_config_define
(
autodev
);
lxc_config_define
(
autodev
);
lxc_config_define
(
apparmor_allow_incomplete
);
lxc_config_define
(
apparmor_allow_incomplete
);
...
...
src/lxc/parse.h
View file @
fd63cb7c
...
@@ -26,17 +26,19 @@
...
@@ -26,17 +26,19 @@
#include <stdio.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/types.h>
#include "compiler.h"
typedef
int
(
*
lxc_dir_cb
)(
const
char
*
name
,
const
char
*
directory
,
typedef
int
(
*
lxc_dir_cb
)(
const
char
*
name
,
const
char
*
directory
,
const
char
*
file
,
void
*
data
);
const
char
*
file
,
void
*
data
);
typedef
int
(
*
lxc_file_cb
)(
char
*
buffer
,
void
*
data
);
typedef
int
(
*
lxc_file_cb
)(
char
*
buffer
,
void
*
data
);
extern
int
lxc_file_for_each_line
(
const
char
*
file
,
lxc_file_cb
callback
,
__hot
extern
int
lxc_file_for_each_line
(
const
char
*
file
,
lxc_file_cb
callback
,
void
*
data
);
extern
int
lxc_file_for_each_line_mmap
(
const
char
*
file
,
lxc_file_cb
callback
,
void
*
data
);
void
*
data
);
__hot
extern
int
lxc_file_for_each_line_mmap
(
const
char
*
file
,
lxc_file_cb
callback
,
void
*
data
);
/* mmap() wrapper. lxc_strmmap() will take care to \0-terminate files so that
/* mmap() wrapper. lxc_strmmap() will take care to \0-terminate files so that
* normal string-handling functions can be used on the buffer. */
* normal string-handling functions can be used on the buffer. */
extern
void
*
lxc_strmmap
(
void
*
addr
,
size_t
length
,
int
prot
,
int
flags
,
int
fd
,
extern
void
*
lxc_strmmap
(
void
*
addr
,
size_t
length
,
int
prot
,
int
flags
,
int
fd
,
...
...
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