Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Thu Mar 28, 2024 8:24 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Memory leak ...
PostPosted: Mon Nov 02, 2009 11:15 am 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
Hello,

Working on rayphp layer.

Found two strange things:

When calling php_exec, lot's of variable are already registered (mouse_x ...) is it normal ?
EDIT-> Ok it's normal.

when calling raydium_register_variable_unregister_last if the variable is constant, address is defined with a malloc, don't we need to call a free for this adress and avoid memory leak ?

Have a nice day.
Ouille


Top
 Profile  
 
 Post subject: Re: Memory leak ...
PostPosted: Mon Nov 02, 2009 5:11 pm 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
Hello,

An other question, is it possible to run a function from the console if this function use the php layer.
I receive a segfault when i try, but changing the skybox work well, and it run r3s scripts.

Have a nice day
Ouille.

EDIT: Header explicit that recursive call is forbiden.


Top
 Profile  
 
 Post subject: Re: Memory leak ...
PostPosted: Mon Nov 02, 2009 10:16 pm 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
Hello,

Using php zip is really easy, but raise lot's of problem, console command will be disable at least.

Is it possible to use zlib to handle zip file ?

It will add a dependency to raydium, the dll is quite small 70Kib.
But zip will be handled internally.

Waiting for advice before doing the work.

Have a nice day.
Ouille.


Top
 Profile  
 
 Post subject: Re: Memory leak ...
PostPosted: Wed Nov 04, 2009 9:00 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
1 - True, a free() is missing when unregistering a RAYDIUM_REGISTER_ICONST or RAYDIUM_REGISTER_FCONST constant. Nice spot.
2 - I'm not sure to understand what you want to do with zip files, but here's the thing, in my opinon: yes, recursive calls to PHP leads to a segfault. Yes, as a workaround, it's possible to use zlib directly, but yes, it's quite sad to "duplicate" what PHP can already do (in facts, PHP interpreter is in Raydium because it's supposed to help for such things). To make it short, the "correct" path would be to dig a lot and find why we're not able to do recursive calls to PHP. Fixing this would allow a lot of excellent features. I'm thinking about this for ages, but never took the time so far :)


Top
 Profile  
 
 Post subject: Re: Memory leak ...
PostPosted: Wed Nov 04, 2009 1:55 pm 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
Hello,

I ve make tons of tests for php. A don't manage to get it working. Sorry.

I try a patch with zlib, we will use the more convenient.

For instance i try to verify linux compatibiliy and it's hard for me, i quite never work on linux sorry.

If you have an idea about this segfaulting i'll try to make some tests.

Have a nice day
Ouille.


Top
 Profile  
 
 Post subject: Re: Memory leak ...
PostPosted: Wed Nov 04, 2009 4:02 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
I'll try to find some free time to solve this once for all. It could lead to some heavy changes in the PHP support for Raydium, such as a "global context" instead of the current "per exec context", where PHP is re-initialized before each call.

For the memory leak, you want to apply the fix ?


Top
 Profile  
 
 Post subject: Re: Memory leak ...
PostPosted: Wed Nov 04, 2009 4:20 pm 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
Hello,

For the memory leak, i don't know exactly where to make the free.

rayphp is a bit nebulous to me ...

If you don't have time i'll try fix this next week. Ok ?

Have a nice day.
Ouille.


Top
 Profile  
 
 Post subject: Re: Memory leak ...
PostPosted: Wed Nov 04, 2009 5:26 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Done with rev 910. Don't wanted to "steal" your job, that's why I asked you ;)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 26 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group