Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ArduinoCore-avr
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
ArduinoCore-avr
Commits
6e0fb1ee
Commit
6e0fb1ee
authored
Sep 17, 2020
by
Matthijs Kooijman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make zero-sized new standards-compliant
This fixes part of #287.
parent
66d06b03
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
cores/arduino/new.cpp
cores/arduino/new.cpp
+4
-0
No files found.
cores/arduino/new.cpp
View file @
6e0fb1ee
...
@@ -23,6 +23,10 @@ namespace std {
...
@@ -23,6 +23,10 @@ namespace std {
}
}
void
*
operator
new
(
size_t
size
)
{
void
*
operator
new
(
size_t
size
)
{
// Even zero-sized allocations should return a unique pointer, but
// malloc does not guarantee this
if
(
size
==
0
)
size
=
1
;
return
malloc
(
size
);
return
malloc
(
size
);
}
}
void
*
operator
new
[](
size_t
size
)
{
void
*
operator
new
[](
size_t
size
)
{
...
...
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