diff options
| author | Joshua Bakita <bakitajoshua@gmail.com> | 2019-10-07 19:13:39 -0400 |
|---|---|---|
| committer | Joshua Bakita <bakitajoshua@gmail.com> | 2019-10-07 19:13:39 -0400 |
| commit | 386b7d3366f1359a265da207a9cafa3edf553b64 (patch) | |
| tree | c76120c2c138faed822e4ae386be6ef22a738a78 /all_pairs/source/audiobeam/audiobeamlibmalloc.c | |
| parent | 54a3f7091a2146b29c73a6fdc4b62a5c4ad7a3d8 (diff) | |
Reorganize and commit all the modified TACLeBench code and run scripts
Diffstat (limited to 'all_pairs/source/audiobeam/audiobeamlibmalloc.c')
| -rw-r--r-- | all_pairs/source/audiobeam/audiobeamlibmalloc.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/all_pairs/source/audiobeam/audiobeamlibmalloc.c b/all_pairs/source/audiobeam/audiobeamlibmalloc.c new file mode 100644 index 0000000..50c3073 --- /dev/null +++ b/all_pairs/source/audiobeam/audiobeamlibmalloc.c | |||
| @@ -0,0 +1,14 @@ | |||
| 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 | } \ No newline at end of file | ||
