Skip to content

Commit

Permalink
don't use malloc for CUSTOM_HOST
Browse files Browse the repository at this point in the history
  • Loading branch information
camel-cdr committed Jul 14, 2024
1 parent bdb5425 commit 5dc20c3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bench/bench.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void bench_main(void);
ux checksum(size_t n);
void init(void);

#if __STDC_HOSTED__
#if __STDC_HOSTED__ && !defined(CUSTOM_HOST)
# include <stdlib.h>
#else
static ux heap[1 + MAX_MEM / sizeof(ux)];
Expand All @@ -72,7 +72,7 @@ int
main(void)
{

#if __STDC_HOSTED__
#if __STDC_HOSTED__ && !defined(CUSTOM_HOST)
mem = malloc(MAX_MEM);
#else
mem = (unsigned char*)heap;
Expand All @@ -87,7 +87,7 @@ main(void)

init();
bench_main();
#if __STDC_HOSTED__
#if __STDC_HOSTED__ && !defined(CUSTOM_HOST)
free(mem);
#endif
return 0;
Expand Down

0 comments on commit 5dc20c3

Please sign in to comment.