Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
relibc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
33
Issues
33
List
Boards
Labels
Service Desk
Milestones
Merge Requests
19
Merge Requests
19
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
redox-os
relibc
Commits
54c5423f
Commit
54c5423f
authored
May 09, 2019
by
Peter Limkilde Svendsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid call to memalign()
parent
8beb10b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
src/header/stdlib/mod.rs
src/header/stdlib/mod.rs
+9
-1
No files found.
src/header/stdlib/mod.rs
View file @
54c5423f
...
...
@@ -1013,7 +1013,15 @@ pub unsafe extern "C" fn valloc(size: size_t) -> *mut c_void {
/* _SC_PAGESIZE is a c_long and may in principle not convert
* correctly to a size_t. */
match
size_t
::
try_from
(
sysconf
(
_
SC_PAGESIZE
))
{
Ok
(
page_size
)
=>
memalign
(
page_size
,
size
),
Ok
(
page_size
)
=>
{
/* valloc() is not supposed to be able to set errno to
* EINVAL, hence no call to memalign(). */
let
ptr
=
platform
::
alloc_align
(
size
,
page_size
);
if
ptr
.is_null
()
{
platform
::
errno
=
errno
::
ENOMEM
;
}
ptr
}
Err
(
_
)
=>
{
// A corner case. No errno setting.
ptr
::
null_mut
()
...
...
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