forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Boehm Garbage Collector any success stories of porting?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Heimdall



Joined: 10 Nov 2005
Posts: 259
Location: Netherlands

PostPosted: Thu Oct 02, 2008 1:00 am    Post subject: Boehm Garbage Collector any success stories of porting? Reply with quote

anyone ever tried to port/build boehm-gc for the PSP (with success :P)?
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Sun Oct 12, 2008 9:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Sun Oct 12, 2008 10:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Sun Oct 12, 2008 10:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Mon Oct 13, 2008 11:27 am    Post subject: Reply with quote

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
View user's profile Send private message
Heimdall



Joined: 10 Nov 2005
Posts: 259
Location: Netherlands

PostPosted: Mon Oct 13, 2008 5:05 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Mon Oct 13, 2008 6:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
moonlight



Joined: 26 Oct 2005
Posts: 567

PostPosted: Mon Oct 13, 2008 6:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group