ngrc version works?
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#define HEAP_SIZE (1024 * 1024)
|
||||
|
||||
void *__global_allocation_pointer__ = NULL;
|
||||
|
||||
void print(char *_ignore, char *variable_name, int64_t vtype, int64_t value) {
|
||||
switch(vtype) {
|
||||
case /* U8 = */ 10:
|
||||
@@ -39,6 +45,18 @@ void print(char *_ignore, char *variable_name, int64_t vtype, int64_t value) {
|
||||
extern void gogogo();
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
__global_allocation_pointer__ = malloc(HEAP_SIZE);
|
||||
if(__global_allocation_pointer__ == NULL) {
|
||||
printf("ERROR: Couldn't allocation heap space.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(memset(__global_allocation_pointer__, 0, HEAP_SIZE) != __global_allocation_pointer__) {
|
||||
printf("ERROR: Weird return trying to zero out heap.");
|
||||
return 2;
|
||||
}
|
||||
|
||||
gogogo();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user