Last active
August 7, 2017 19:16
-
-
Save Oxore/a655a05fe3700e0f1ac82ed617ab8cc6 to your computer and use it in GitHub Desktop.
Утечка в коде как в сях
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
#include <iostream> | |
#include <string.h> | |
#include <stdlib.h> | |
using namespace std; | |
int main() | |
{ | |
void *a; | |
long int n = 10000000; | |
while (1) { | |
a = (char *)malloc(n); | |
printf("%ld bytes allocated, occupying...", n); | |
memset(a, 0, n); | |
printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b and occupied\n"); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment