We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c8c17c commit f35edf5Copy full SHA for f35edf5
func/demo/calloc.cpp
@@ -13,13 +13,13 @@
13
int main(int argc, char* argv[])
14
{
15
int callocSize = 100;
16
- int n = 1000;
+ int n = 100;
17
char* callocPtrs[n];
18
char* mmapPtrs[n];
19
int mmapLen = 20;
20
21
// Use calloc to allocate lots of smaller memory regions
22
- for (int i = 0; i < 1000; i++) {
+ for (int i = 0; i < n; i++) {
23
char* callocPtr = (char*)calloc(1, callocSize);
24
std::string s = "number ";
25
s += std::to_string(i);
@@ -38,7 +38,7 @@ int main(int argc, char* argv[])
38
}
39
40
// Go back through and check everything is still intact
41
- for (int j = 0; j < 1000; j++) {
+ for (int j = 0; j < n; j++) {
42
char* nextPtr = callocPtrs[j];
43
std::string actual(nextPtr);
44
std::string expected = "number ";
0 commit comments