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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
10 deletions
+17
-10
compiler.h
src/lxc/compiler.h
+4
-0
confile.c
src/lxc/confile.c
+7
-6
parse.h
src/lxc/parse.h
+6
-4
No files found.
src/lxc/compiler.h
View file @
fd63cb7c
...
...
@@ -54,6 +54,10 @@
# endif
#endif
#ifndef __hot
# define __hot __attribute__((hot))
#endif
#define __cgfsng_ops
#endif
/* __LXC_COMPILER_H */
src/lxc/confile.c
View file @
fd63cb7c
...
...
@@ -70,12 +70,13 @@
lxc_log_define
(
confile
,
lxc
);
#define lxc_config_define(name) \
static int set_config_##name(const char *, const char *, \
struct lxc_conf *, void *); \
static int get_config_##name(const char *, char *, int, \
struct lxc_conf *, void *); \
static int clr_config_##name(const char *, struct lxc_conf *, void *);
#define lxc_config_define(name) \
__hot static int set_config_##name(const char *, const char *, \
struct lxc_conf *, void *); \
__hot static int get_config_##name(const char *, char *, int, \
struct lxc_conf *, void *); \
__hot static int clr_config_##name(const char *, struct lxc_conf *, \
void *);
lxc_config_define
(
autodev
);
lxc_config_define
(
apparmor_allow_incomplete
);
...
...
src/lxc/parse.h
View file @
fd63cb7c
...
...
@@ -26,16 +26,18 @@
#include <stdio.h>
#include <sys/types.h>
#include "compiler.h"
typedef
int
(
*
lxc_dir_cb
)(
const
char
*
name
,
const
char
*
directory
,
const
char
*
file
,
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
,
void
*
data
);
__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
);
__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
* normal string-handling functions can be used on the buffer. */
...
...
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