diff options
| author | leochanj105 <leochanj@live.unc.edu> | 2021-10-26 13:22:32 -0400 |
|---|---|---|
| committer | leochanj105 <leochanj@live.unc.edu> | 2021-10-26 13:22:32 -0400 |
| commit | 14c854543b1a3cf344a371a5b45595657f95786b (patch) | |
| tree | 70f752880522e5e44669af365754ac0f649dce81 /all_pairs/source/audiobeam/audiobeamlibmalloc.c | |
| parent | 5e2ccfae0532ddd89bcc04bf14aad451e9c79785 (diff) | |
add deadlines and costs
Diffstat (limited to 'all_pairs/source/audiobeam/audiobeamlibmalloc.c')
| -rw-r--r-- | all_pairs/source/audiobeam/audiobeamlibmalloc.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/all_pairs/source/audiobeam/audiobeamlibmalloc.c b/all_pairs/source/audiobeam/audiobeamlibmalloc.c deleted file mode 100644 index a81b634..0000000 --- a/all_pairs/source/audiobeam/audiobeamlibmalloc.c +++ /dev/null | |||
| @@ -1,19 +0,0 @@ | |||
| 1 | #include "audiobeamlibmalloc.h" | ||
| 2 | |||
| 3 | #define AUDIOBEAM_HEAP_SIZE 10000 | ||
| 4 | |||
| 5 | static char audiobeam_simulated_heap[AUDIOBEAM_HEAP_SIZE]; | ||
| 6 | static unsigned int audiobeam_freeHeapPos; | ||
| 7 | |||
| 8 | void *audiobeam_malloc( unsigned int numberOfBytes ) | ||
| 9 | { | ||
| 10 | void *currentPos = ( void * )&audiobeam_simulated_heap[ audiobeam_freeHeapPos ]; | ||
| 11 | /* Get a 4-byte address for alignment purposes */ | ||
| 12 | audiobeam_freeHeapPos += ( ( numberOfBytes + 4 ) & ( unsigned int )0xfffffffc ); | ||
| 13 | return currentPos; | ||
| 14 | } | ||
| 15 | |||
| 16 | void audiobeam_free_all( void ) | ||
| 17 | { | ||
| 18 | audiobeam_freeHeapPos = 0; | ||
| 19 | } | ||
