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
d97919ab
Unverified
Commit
d97919ab
authored
Feb 07, 2019
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: partially switch to cleanup macros
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
42bd57bd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
cgfsng.c
src/lxc/cgroups/cgfsng.c
+0
-0
memory_utils.h
src/lxc/memory_utils.h
+18
-0
No files found.
src/lxc/cgroups/cgfsng.c
View file @
d97919ab
This diff is collapsed.
Click to expand it.
src/lxc/memory_utils.h
View file @
d97919ab
...
...
@@ -20,13 +20,31 @@
#ifndef __LXC_MEMORY_UTILS_H
#define __LXC_MEMORY_UTILS_H
#include <dirent.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
static
inline
void
__auto_free__
(
void
*
p
)
{
free
(
*
(
void
**
)
p
);
}
static
inline
void
__auto_fclose__
(
FILE
**
f
)
{
if
(
*
f
)
fclose
(
*
f
);
}
static
inline
void
__auto_closedir__
(
DIR
**
d
)
{
if
(
*
d
)
closedir
(
*
d
);
}
#define __do_free __attribute__((__cleanup__(__auto_free__)))
#define __do_fclose __attribute__((__cleanup__(__auto_fclose__)))
#define __do_closedir __attribute__((__cleanup__(__auto_closedir__)))
#endif
/* __LXC_MEMORY_UTILS_H */
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