Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
764e0027
Commit
764e0027
authored
11 years ago
by
Christian Mehlis
Browse files
Options
Downloads
Patches
Plain Diff
add oneway calloc
parent
93e470eb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/include/oneway_malloc.h
+1
-0
1 addition, 0 deletions
core/include/oneway_malloc.h
core/oneway_malloc.c
+9
-0
9 additions, 0 deletions
core/oneway_malloc.c
with
10 additions
and
0 deletions
core/include/oneway_malloc.h
+
1
−
0
View file @
764e0027
...
...
@@ -13,6 +13,7 @@
void
*
_malloc
(
size_t
size
);
void
*
_realloc
(
void
*
ptr
,
size_t
size
);
void
*
_calloc
(
int
size
,
size_t
cnt
);
void
_free
(
void
*
ptr
);
/** @} */
...
...
This diff is collapsed.
Click to expand it.
core/oneway_malloc.c
+
9
−
0
View file @
764e0027
...
...
@@ -47,6 +47,15 @@ void *_realloc(void *ptr, size_t size)
return
newptr
;
}
void
*
_calloc
(
int
size
,
size_t
cnt
)
{
void
*
mem
=
_malloc
(
size
*
cnt
);
if
(
mem
)
{
memset
(
mem
,
0
,
size
*
cnt
);
}
return
mem
;
}
void
_free
(
void
*
ptr
)
{
/* who cares about pointers? */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment