Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
849d42af
Commit
849d42af
authored
Aug 11, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clear in chucks of 128k with watch_dog refresh in between
parent
294958a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
ndb/src/kernel/vm/SimulatedBlock.cpp
ndb/src/kernel/vm/SimulatedBlock.cpp
+13
-3
No files found.
ndb/src/kernel/vm/SimulatedBlock.cpp
View file @
849d42af
...
@@ -639,7 +639,7 @@ void*
...
@@ -639,7 +639,7 @@ void*
SimulatedBlock
::
allocRecord
(
const
char
*
type
,
size_t
s
,
size_t
n
,
bool
clear
)
SimulatedBlock
::
allocRecord
(
const
char
*
type
,
size_t
s
,
size_t
n
,
bool
clear
)
{
{
void
*
p
=
NULL
;
void
*
p
=
NULL
;
size_t
size
=
n
*
s
;
size_t
size
=
n
*
s
;
refresh_watch_dog
();
refresh_watch_dog
();
if
(
size
>
0
){
if
(
size
>
0
){
...
@@ -662,8 +662,18 @@ SimulatedBlock::allocRecord(const char * type, size_t s, size_t n, bool clear)
...
@@ -662,8 +662,18 @@ SimulatedBlock::allocRecord(const char * type, size_t s, size_t n, bool clear)
ERROR_SET
(
fatal
,
ERR_MEMALLOC
,
buf1
,
buf2
);
ERROR_SET
(
fatal
,
ERR_MEMALLOC
,
buf1
,
buf2
);
}
}
if
(
clear
)
if
(
clear
){
memset
(
p
,
0
,
size
);
char
*
ptr
=
(
char
*
)
p
;
const
Uint32
chunk
=
128
*
1024
;
while
(
size
>
chunk
){
refresh_watch_dog
();
memset
(
ptr
,
0
,
chunk
);
ptr
+=
chunk
;
size
-=
chunk
;
}
refresh_watch_dog
();
memset
(
ptr
,
0
,
size
);
}
}
}
return
p
;
return
p
;
}
}
...
...
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