summaryrefslogtreecommitdiff
path: root/amiga/misc.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2015-01-10 23:10:05 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2015-01-10 23:10:05 +0000
commit80558b3116c911f06ae7d482c226865b55feacea (patch)
tree478d04168b31f3164c5830fce6f4d1251fa82a12 /amiga/misc.c
parent3630d7348de4ddaf5bd01ce2a7eb9dd81b0f6af4 (diff)
downloadnetsurf-80558b3116c911f06ae7d482c226865b55feacea.tar.gz
netsurf-80558b3116c911f06ae7d482c226865b55feacea.tar.bz2
Use a function to create ready-cleared memory
Diffstat (limited to 'amiga/misc.c')
-rwxr-xr-xamiga/misc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/amiga/misc.c b/amiga/misc.c
index 2f2f93eb8..0cd3baedd 100755
--- a/amiga/misc.c
+++ b/amiga/misc.c
@@ -34,6 +34,19 @@
#include "amiga/misc.h"
#include "amiga/utf8.h"
+void *ami_misc_allocvec_clear(int size, UBYTE value)
+{
+#ifdef __amigaos4__
+ return AllocVecTags(size, AVT_ClearWithValue, value, TAG_DONE);
+#else
+ void *mem = AllocVec(size, MEMF_CLEAR);
+ if (mem && (value != 0)) {
+ memset(mem, value, size);
+ }
+ return mem;
+#endif
+}
+
static LONG ami_misc_req(const char *message, uint32 type)
{
LONG ret = 0;