summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorssolie <ssolie>2006-03-19 04:32:58 +0000
committerssolie <ssolie>2006-03-19 04:32:58 +0000
commitc9d99c8818e6bd929719fe5593ec53d7aaac3d41 (patch)
tree38cf8d8241295a11ac418a71641f72532e0bbcc8
parentaad99dbb0be0aed587c7b47f8f14fcdc54dee5d9 (diff)
downloadlibexpat-c9d99c8818e6bd929719fe5593ec53d7aaac3d41.tar.gz
now allocates shared memory and frees the correct memory block
-rwxr-xr-xamiga/stdlib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/amiga/stdlib.c b/amiga/stdlib.c
index 4a7ca71..aa6f73a 100755
--- a/amiga/stdlib.c
+++ b/amiga/stdlib.c
@@ -30,7 +30,7 @@ void * malloc (size_t len)
{
uint32 size = sizeof(uint32) + len;
- uint32 *mem = AllocMem(size, MEMF_ANY);
+ uint32 *mem = AllocMem(size, MEMF_SHARED);
if ( mem != 0 ) {
*mem = size;
++mem;
@@ -67,8 +67,8 @@ void * realloc (void * mem, size_t len2)
void free (void * mem)
{
if ( mem != 0 ) {
- uint32 size = *(((uint32*)mem) - 1);
- FreeMem(mem, size);
+ uint32 * size_ptr = ((uint32*)mem) - 1;
+ FreeMem(size_ptr, *size_ptr);
}
}