Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
f6d21b50
Commit
f6d21b50
authored
Jun 09, 2010
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
alloc: fix page header size calculation bug, increase type safety.
parent
dfdebb7c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
ccan/alloc/alloc.c
ccan/alloc/alloc.c
+3
-3
No files found.
ccan/alloc/alloc.c
View file @
f6d21b50
...
...
@@ -275,9 +275,9 @@ static unsigned long align_up(unsigned long x, unsigned long align)
return
(
x
+
align
-
1
)
&
~
(
align
-
1
);
}
static
void
*
from_off
(
struct
header
*
head
,
unsigned
long
off
)
static
struct
page_header
*
from_off
(
struct
header
*
head
,
unsigned
long
off
)
{
return
(
char
*
)
head
+
off
;
return
(
struct
page_header
*
)((
char
*
)
head
+
off
)
;
}
static
unsigned
long
to_off
(
struct
header
*
head
,
void
*
p
)
...
...
@@ -287,7 +287,7 @@ static unsigned long to_off(struct header *head, void *p)
static
size_t
used_size
(
unsigned
int
num_elements
)
{
return
(
num_elements
+
BITS_PER_LONG
-
1
)
/
BITS_PER_LONG
;
return
align_up
(
num_elements
,
BITS_PER_LONG
)
/
CHAR_BIT
;
}
/*
...
...
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