|
|
SqPlus modifications
Last post 01-12-2008, 12:36 PM by ats. 32 replies.
-
-
-
-
-
-
-
-
-
09-27-2007, 7:32 AM |
-
Katsuaki Kawachi
-
-
-
Joined on 06-27-2006
-
Tokyo, Japan
-
Posts 57
-
-
|
Hi I've made a branch named branches/arst-severalVMs, and the snapshot of trunk is released as SQUIRREL2_1_1_sqplus_snapshot_20070927. As for multiple VMs, I misunderstood the problem. You're right. I didn't distinguish switching several VMs from managing concurrent (multithreaded) VMs. There had been a patched version of sqplus for multithreading, but I can't find the page now. Regards, K. Kawachi
|
|
-
09-27-2007, 9:42 AM |
-
10-14-2007, 7:09 AM |
-
-
10-20-2007, 8:26 AM |
-
ats
-
-
-
Joined on 01-17-2007
-
-
Posts 89
-
-
|
Hello,
For class SquirrelVM, the sitiation is a bit unclear. Since it has static variables, it's mostly a placeholder for a SQVM pointer (preferably the one being run currently).
I can see compelling reasons to put all sorts of functionality and convenience into it, but, it becomes burdensome when used in slightly other ways than the author did.
I think that creating VM:s automatically, starting to initialize libraries, well in general users of probably SqPlus will prefer to control that sort of thing themselves.
When swapping between VM:s and SquirrelVM itself has created a VM, then who has the ownership for the VM being swapped out? Maybe better to do an assert(v!=NULL) in SquirrelVM::Init.
When it comes to SetVMSys, are some issues: 1 - A VM already always has a root table associated with it internally. Passing it around as a separate object leaves questions open. Who owns the object? 2 - In SetVMSys, the current state is just being overwritten, with no release or consideration for what was there before.
We come in the situation where _root is sometimes created by SquirrelVM and sometimes externally.
I think it's best to know what SquirrelVM is supposed to do and not try to pack all sorts of 'possibly convenient' things in there.
IMHO it's best to drop SquirrelVMSys. Internally one can create a SquirrelObject representing the root, if this gives performance improvement, but the it must be properly deleted whenever the VM is swapped out of context.
Maybe best to check if someone is really dependent on SquirrelVMSys?
BTW: I could complete a rewrite along these lines. However, if you've nearly done it I shouldn't. And, it's probably best to have some test cases for VM swapping also.
For the other big change - Unicode(char/wchar_t), I'm almost ready to commit now.
Regards // ATS.
|
|
-
-
01-11-2008, 2:40 PM |
|
|
Hi.
I guess I'm actually asking to ats who seems to have solved some problems similar to mine.
In fact, I recently upgraded my Ubuntu to the latest and my project using Ogre and Squirrel with SqPlus didn't compile anymore. Checking the website I saw the new version and downloaded it. I had a bunch of problems related to undefined references when linking ; my gcc reports version "gcc (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2) " so I thought the inline workaround should do it. It seems to help but doesn't seem to be enough.
[EDIT] Just to inform you that I just tested the latest SVN version and the same problem arises. [/EDIT]
In my projetc, I modified the following defines from their default value: SQPLUS_CONST_OPT, SQPLUS_SUPPORT_STD_STRING and GCC_INLINE_WORKAROUND. The version of Squirrel/SqPlus is SQUIRREL2_1_1_sqplus_snapshot_20071014.
The last problem reported by the linker: game.so: undefined reference to `void SqPlus::Push<Ogre::Quaternion const>(SQVM*, Ogre::Quaternion const&)' game.so: undefined reference to `void SqPlus::Push<Ogre::Vector3 const>(SQVM*, Ogre::Vector3 const&)' collect2: ld a retourné 1 code d'état d'exécution
They look like the errors which happened without the gcc inline workaround so I guess something is not completely right with it but I don't know what. I would guess it has to do with one of my defines (SQPLUS_CONST_OPT ?) but everything that I tried failed...
Note that I declare the Ogre classes the same way I do for mine: DECLARE_INSTANCE_TYPE_NAME(Game::Camera, Camera) DECLARE_INSTANCE_TYPE_NAME(Ogre::Vector3, Vector3) DECLARE_INSTANCE_TYPE_NAME(Ogre::Quaternion, Quaternion)
Any idea ?
Thanks forward, Seb
|
|
Page 2 of 3 (33 items)
2
|
|