Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
1c98609a
Commit
1c98609a
authored
May 03, 2015
by
miloyip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Standardize MemoryPoolAllocator::Realloc() also, and improve coverage
parent
ae61b797
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
allocators.h
include/rapidjson/allocators.h
+3
-0
allocatorstest.cpp
test/unittest/allocatorstest.cpp
+3
-0
No files found.
include/rapidjson/allocators.h
View file @
1c98609a
...
...
@@ -189,6 +189,9 @@ public:
if
(
originalPtr
==
0
)
return
Malloc
(
newSize
);
if
(
newSize
==
0
)
return
NULL
;
// Do not shrink if new size is smaller than original
if
(
originalSize
>=
newSize
)
return
originalPtr
;
...
...
test/unittest/allocatorstest.cpp
View file @
1c98609a
...
...
@@ -42,6 +42,9 @@ void TestAllocator(Allocator& a) {
EXPECT_EQ
(
i
,
r
[
i
]);
Allocator
::
Free
(
r
);
// Realloc to zero size
EXPECT_TRUE
(
a
.
Realloc
(
a
.
Malloc
(
1
),
1
,
0
)
==
0
);
}
TEST
(
Allocator
,
CrtAllocator
)
{
...
...
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