diff options
Diffstat (limited to 'baseline/source/susan/wccmalloc.c')
| -rw-r--r-- | baseline/source/susan/wccmalloc.c | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/baseline/source/susan/wccmalloc.c b/baseline/source/susan/wccmalloc.c deleted file mode 100644 index edf01cc..0000000 --- a/baseline/source/susan/wccmalloc.c +++ /dev/null | |||
| @@ -1,51 +0,0 @@ | |||
| 1 | #include "wccmalloc.h" | ||
| 2 | |||
| 3 | // This must be redefined for each new benchmark | ||
| 4 | #define HEAP_SIZE 30000 | ||
| 5 | |||
| 6 | char susan_simulated_heap[HEAP_SIZE]; | ||
| 7 | unsigned int susan_freeHeapPos; | ||
| 8 | |||
| 9 | void* susan_wccmalloc( unsigned int numberOfBytes ) | ||
| 10 | { | ||
| 11 | // Get a 4-byte adress for alignment purposes | ||
| 12 | unsigned int offset = ( (unsigned long)susan_simulated_heap + susan_freeHeapPos ) % 4; | ||
| 13 | if ( offset ) { | ||
| 14 | susan_freeHeapPos += 4 - offset; | ||
| 15 | } | ||
| 16 | void* currentPos = (void*)&susan_simulated_heap[susan_freeHeapPos]; | ||
| 17 | susan_freeHeapPos += numberOfBytes; | ||
| 18 | return currentPos; | ||
| 19 | } | ||
| 20 | void susan_wccfreeall( void ) | ||
| 21 | { | ||
| 22 | susan_freeHeapPos = 0; | ||
| 23 | } | ||
| 24 | |||
| 25 | void* susan_wccmemcpy(void* dstpp, const void* srcpp, unsigned int len) | ||
| 26 | { | ||
| 27 | unsigned long int dstp = (long int) dstpp; | ||
| 28 | unsigned long int srcp = (long int) srcpp; | ||
| 29 | |||
| 30 | _Pragma("loopbound min 76 max 76") | ||
| 31 | while (len > 0) { | ||
| 32 | char __x = ((char *) srcp)[0]; | ||
| 33 | srcp += 1; | ||
| 34 | len -= 1; | ||
| 35 | ((char *) dstp)[0] = __x; | ||
| 36 | dstp += 1; | ||
| 37 | } | ||
| 38 | |||
| 39 | return dstpp; | ||
| 40 | } | ||
| 41 | |||
| 42 | void susan_wccmemset( void *p, int value, unsigned int num ) | ||
| 43 | { | ||
| 44 | unsigned long i; | ||
| 45 | char *char_ptr = (char*)p; | ||
| 46 | |||
| 47 | _Pragma( "loopbound min 7220 max 28880" ) | ||
| 48 | for ( i = 0; i < num; ++i ) { | ||
| 49 | *char_ptr++ = (unsigned char)value; | ||
| 50 | } | ||
| 51 | } | ||
