-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Maarten Sijm <[email protected]>
- Loading branch information
Showing
5 changed files
with
72 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
test/problems/hellounix/submissions/run_time_error/test-memsize_512.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* This should fail with RUN-ERROR due to running out of memory, which | ||
* is restricted. | ||
* | ||
* Note: This may try to create a coredump on exit and time out. This | ||
* can be prevented with `ulimit -c 0`. | ||
*/ | ||
|
||
#include <iostream> | ||
#include <vector> | ||
|
||
using namespace std; | ||
|
||
const size_t mb = 513; | ||
|
||
int main() { | ||
std::cerr << "Trying to allocate at least: " << 513 << " MB" << std::endl; | ||
vector<char> v(513 * 1024 * 1024); | ||
std::cerr << "Allocated: " << v.size() << " MB" << std::endl; | ||
return 0; | ||
} |