diff options
author | Dave Chapman <dave@dchapman.com> | 2006-04-03 22:57:39 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2006-04-03 22:57:39 +0000 |
commit | e59a0505095a8f57ba4f8e2551024c276e9475e8 (patch) | |
tree | 2e1d66516b2bd1564c1691aa4cc4c59dd22bec8f /apps/plugins | |
parent | 8c177221b31d9b86aa286092ede463a1c5f0a4b4 (diff) | |
download | rockbox-e59a0505095a8f57ba4f8e2551024c276e9475e8.tar.gz rockbox-e59a0505095a8f57ba4f8e2551024c276e9475e8.zip |
Workaround for Rockbox's broken memset on ARM
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9476 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/doom/z_zone.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/apps/plugins/doom/z_zone.c b/apps/plugins/doom/z_zone.c index ed3a6918d9..cc3d11abc4 100644 --- a/apps/plugins/doom/z_zone.c +++ b/apps/plugins/doom/z_zone.c | |||
@@ -630,9 +630,25 @@ void *(Z_Calloc)(size_t n1, size_t n2, int tag, void **user | |||
630 | , const char *file, int line | 630 | , const char *file, int line |
631 | #endif | 631 | #endif |
632 | ) | 632 | ) |
633 | { | 633 | { void* s; |
634 | return | 634 | |
635 | (n1*=n2) ? memset((Z_Malloc)(n1, tag, user DA(file, line)), 0, n1) : NULL; | 635 | /* The ARM version of memset doesn't correctly return a pointer |
636 | to the memory address being set, so we have to do this the long | ||
637 | way... Revert this when the ARM memset is fixed. | ||
638 | |||
639 | */ | ||
640 | |||
641 | #if 1 | ||
642 | if (n1*=n2) { | ||
643 | s = (Z_Malloc)(n1,tag,user DA(file,line)); | ||
644 | memset(s, 0, n1); | ||
645 | return s; | ||
646 | } else { | ||
647 | return NULL; | ||
648 | } | ||
649 | #else | ||
650 | return (n1*=n2) ? memset((Z_Malloc)(n1, tag, user DA(file, line)), 0, n1) : NULL; | ||
651 | #endif | ||
636 | } | 652 | } |
637 | 653 | ||
638 | char *(Z_Strdup)(const char *s, int tag, void **user | 654 | char *(Z_Strdup)(const char *s, int tag, void **user |