classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] FYI: malloc and free targetizized


From: Roman Kennke
Subject: Re: [cp-patches] FYI: malloc and free targetizized
Date: Tue, 17 Jan 2006 21:10:33 +0100 (CET)

Hi Tromey,


Am 17.1.2006 schrieb "Tom Tromey" <address@hidden>:

>>>>>> "Roman" == Roman Kennke <address@hidden> writes:
>
>Roman> I replaced calls to malloc() and free() in jcl.c and
>Roman> native_state.c with the corresponding target macros for
>Roman> improved portability.
>
>Roman> -  void *mem = malloc (size);
>Roman> +  void *mem;
>Roman> +  TARGET_NATIVE_MEMORY_ALLOC(mem,void *,size);
>
>This is super ugly.  Couldn't the allocator macro return a value?

I agree. I will look into this and see if I can fix it.

>Also, what platform requires us not to call 'malloc'?

This is needed (for instance) on Windows CE for 2 reasons. 1. On Windows
CE the available heap memory for a process is normally limited to 32MB.
This is checked and an exception thrown. 2. The function to allocate
that is called VirtualAlloc rather than malloc. I know this target is
not included in Classpath atm. I'll ask my bosses if it would be ok for
them to also include this in classpath. However, this port is rather new
and not very stable yet...

OTOH, the plan is to get rid of the macros for syscalls soon anyway and
change them into function calls. However, I would first like to get
(Jamaica) in sync with Classpath again, it looks like there hasn't been
exchange of native code between Aicas and Classpath for ages, mostly due
to the differences regarding the target native layer in the past. Which
I hope to get fixed now soon.

Cheers, Roman




reply via email to

[Prev in Thread] Current Thread [Next in Thread]