Boehm Garbage Collector any success stories of porting?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Boehm Garbage Collector any success stories of porting?

Post by Heimdall »

anyone ever tried to port/build boehm-gc for the PSP (with success :P)?
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

Can't find anything on it. But 'D' language has a garbage collector I believe.

In any case good programmers shouldn't leave garbage and it makes me sick to see such code.

I harbor similar hatred towards malloc() and the heap on the PSP. sceKernelAllocPartitionMemory FTW. Hell, malloc() should have just been a wrapper around sceKernelAllocPartitionMemory, just to make porting old stuff easier.

Let the bashing begin.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Unfortunately if I recall sceAllocPartitionMemory allocates fixed sized chunks of memory, so if you has alot of small allocations it would quickly nuke all of memory, which is why you need some sort of heap management. Malloc is standardised, if you don't like it you don't have to use it, or any of the rest of libc, it is entirely up to you :)
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

TyRaNiD wrote:Unfortunately if I recall sceAllocPartitionMemory allocates fixed sized chunks of memory, so if you has alot of small allocations it would quickly nuke all of memory, which is why you need some sort of heap management. Malloc is standardised, if you don't like it you don't have to use it, or any of the rest of libc, it is entirely up to you :)
To be particular about my problem, I'm using DAX's VLF lib in my app which allows you to load custom themes. I'm forced to defined a fixed heap size which may be too small or too big for the user's custom theme.

I can allocate using the sce functions for reading the file, but VLF needs the heap to load the images. >:|
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Well then just implement your own malloc wrapper, the way malloc is defined means you can just replace it with what ever you want, it is only an issue if the library uses its own internal malloc which you can't override.
Heimdall
Posts: 245
Joined: Thu Nov 10, 2005 1:29 am
Location: Netherlands
Contact:

Post by Heimdall »

My original post was because I was trying to get libgcj to compile for the psp. I managed to get the whole compiler (gcj) to build and it compiles java code to psp mips, however it doesn't link because i didn't manage to get libgcj to compile. Libgcj has a dependency on bohem gc that's why i was trying to get some help.
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

TyRaNiD wrote:it is only an issue if the library uses its own internal malloc which you can't override.
Which appears to be the case because VLF uses its own libc and your app can also only use vlflibc.

It wouldn't be a problem if it was a standalone game mode eboot, but my app is a vshmain.prx replacement so the Sony VSH modules also allocate memory. And I can't define an arbitrary value for heap because the Phat and Slim have different amounts of free memory in the VSH.
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

Heimdall wrote:My original post was because I was trying to get libgcj to compile for the psp. I managed to get the whole compiler (gcj) to build and it compiles java code to psp mips, however it doesn't link because i didn't manage to get libgcj to compile. Libgcj has a dependency on bohem gc that's why i was trying to get some help.
It would be nice native java on psp, I hope you can achieve it :)
Post Reply