| View previous topic :: View next topic |
| Author |
Message |
Heimdall
Joined: 10 Nov 2005 Posts: 259 Location: Netherlands
|
Posted: Thu Oct 02, 2008 1:00 am Post subject: Boehm Garbage Collector any success stories of porting? |
|
|
| anyone ever tried to port/build boehm-gc for the PSP (with success :P)? |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Sun Oct 12, 2008 9:37 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Sun Oct 12, 2008 10:25 pm Post subject: |
|
|
| 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 :) |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Sun Oct 12, 2008 10:31 pm Post subject: |
|
|
| 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. >:| |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Mon Oct 13, 2008 11:27 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Heimdall
Joined: 10 Nov 2005 Posts: 259 Location: Netherlands
|
Posted: Mon Oct 13, 2008 5:05 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Mon Oct 13, 2008 6:15 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Mon Oct 13, 2008 6:56 pm Post subject: |
|
|
| 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 :) |
|
| Back to top |
|
 |
|