Skip to content

Commit

Permalink
[auto-verifier] docs commit e36456b
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow authored Oct 3, 2023
1 parent 5bc918b commit 195599b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,9 @@ data:
- icon: ':heavy_check_mark:'
path: debug.h
title: debug.h
- icon: ':warning:'
path: stack_increase.cpp
title: stack_increase.cpp
- icon: ':heavy_check_mark:'
path: template.h
title: template.h
Expand Down
43 changes: 43 additions & 0 deletions stack_increase.cpp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
data:
_extendedDependsOn: []
_extendedRequiredBy: []
_extendedVerifiedWith: []
_isVerificationFailed: false
_pathExtension: cpp
_verificationStatusIcon: ':warning:'
attributes:
links:
- https://codeforces.com/blog/entry/120772
bundledCode: "#line 1 \"stack_increase.cpp\"\n// Source: https://codeforces.com/blog/entry/120772\n\
#include <bits/stdc++.h>\nusing namespace std;\nvoid main_() {\n // implement\
\ your solution here\n}\nstatic void run_with_stack_size(void (*func)(void), size_t\
\ stsize) {\n char *stack, *send;\n stack = (char *)malloc(stsize);\n \
\ send = stack + stsize - 16;\n send = (char *)((uintptr_t)send / 16 * 16);\n\
\ asm volatile(\n \"mov %%rsp, (%0)\\n\"\n \"mov %0, %%rsp\\\
n\"\n :\n : \"r\"(send));\n func();\n asm volatile(\"mov (%0),\
\ %%rsp\\n\" : : \"r\"(send));\n free(stack);\n}\nint main() {\n run_with_stack_size(main_,\
\ 1024 * 1024 * 1024); // run with a 1 GiB stack\n return 0;\n}\n"
code: "// Source: https://codeforces.com/blog/entry/120772\n#include <bits/stdc++.h>\n\
using namespace std;\nvoid main_() {\n // implement your solution here\n}\n\
static void run_with_stack_size(void (*func)(void), size_t stsize) {\n char\
\ *stack, *send;\n stack = (char *)malloc(stsize);\n send = stack + stsize\
\ - 16;\n send = (char *)((uintptr_t)send / 16 * 16);\n asm volatile(\n\
\ \"mov %%rsp, (%0)\\n\"\n \"mov %0, %%rsp\\n\"\n :\n \
\ : \"r\"(send));\n func();\n asm volatile(\"mov (%0), %%rsp\\n\" :\
\ : \"r\"(send));\n free(stack);\n}\nint main() {\n run_with_stack_size(main_,\
\ 1024 * 1024 * 1024); // run with a 1 GiB stack\n return 0;\n}\n"
dependsOn: []
isVerificationFile: false
path: stack_increase.cpp
requiredBy: []
timestamp: '2023-10-03 14:50:28-07:00'
verificationStatus: LIBRARY_NO_TESTS
verifiedWith: []
documentation_of: stack_increase.cpp
layout: document
redirect_from:
- /library/stack_increase.cpp
- /library/stack_increase.cpp.html
title: stack_increase.cpp
---

0 comments on commit 195599b

Please sign in to comment.