diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2016-01-21 00:08:49 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2016-01-21 00:08:49 +0000 |
commit | 6d2a78738084a17d860a9eb96ada16150eeba14d (patch) | |
tree | 3e2a92bac2f3c63226324bf3dbec020fc4271c7a /amiga/misc.c | |
parent | 239f999936663c9832bc7569133e694c1ce72741 (diff) | |
download | netsurf-6d2a78738084a17d860a9eb96ada16150eeba14d.tar.gz netsurf-6d2a78738084a17d860a9eb96ada16150eeba14d.tar.bz2 |
Allocate deferred rectangles using itempools
On OS3 we use a normal memory pool instead
Diffstat (limited to 'amiga/misc.c')
-rwxr-xr-x | amiga/misc.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/amiga/misc.c b/amiga/misc.c index 141994a31..065909e85 100755 --- a/amiga/misc.c +++ b/amiga/misc.c @@ -47,6 +47,47 @@ void *ami_misc_allocvec_clear(int size, UBYTE value) #endif } +APTR ami_misc_itempool_create(int size) +{ +#ifdef __amigaos4__ + return AllocSysObjectTags(ASOT_ITEMPOOL, + ASOITEM_MFlags, MEMF_PRIVATE, + ASOITEM_ItemSize, size, + ASOITEM_GCPolicy, ITEMGC_AFTERCOUNT, + ASOITEM_GCParameter, 50, + TAG_DONE); +#else + return CreatePool(MEMF_ANY, 2 * size, size); +#endif +} + +void ami_misc_itempool_delete(APTR pool) +{ +#ifdef __amigaos4__ + FreeSysObject(ASOT_ITEMPOOL, pool); +#else + DeletePool(pool); +#endif +} + +APTR ami_misc_itempool_alloc(APTR pool, int size) +{ +#ifdef __amigaos4__ + return ItemPoolAlloc(pool); +#else + return AllocPooled(pool, size); +#endif +} + +void ami_misc_itempool_free(APTR pool, APTR item, int size) +{ +#ifdef __amigaos4__ + return ItemPoolFree(pool, item); +#else + return FreePooled(pool, item, size); +#endif +} + static LONG ami_misc_req(const char *message, uint32 type) { LONG ret = 0; |