summaryrefslogtreecommitdiff
path: root/frontends/amiga/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/amiga/memory.c')
-rwxr-xr-xfrontends/amiga/memory.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/frontends/amiga/memory.c b/frontends/amiga/memory.c
index 874f8521e..7a34f7abd 100755
--- a/frontends/amiga/memory.c
+++ b/frontends/amiga/memory.c
@@ -25,17 +25,28 @@
ULONG __slab_max_size = 8192; /* Enable clib2's slab allocator */
#endif
-void *ami_misc_allocvec_clear(int size, UBYTE value)
+/* Special clear (ie. non-zero), which is different on OS3 and 4 */
+void *ami_memory_clear_alloc(size_t size, UBYTE value)
{
#ifdef __amigaos4__
return AllocVecTags(size, AVT_ClearWithValue, value, TAG_DONE);
#else
- void *mem = AllocVec(size, MEMF_ANY);
+ void *mem = malloc(size);
if (mem) memset(mem, value, size);
return mem;
#endif
}
+/* Free special clear (ie. non-zero) area, which is different on OS3 and 4 */
+void ami_memory_clear_free(void *p)
+{
+#ifdef __amigaos4__
+ FreeVec(p);
+#else
+ free(p);
+#endif
+}
+
APTR ami_misc_itempool_create(int size)
{
#ifdef __amigaos4__