Luabind cannot register too many classes?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Luabind cannot register too many classes?

"Голубев С.В."
I'm using the splitted class registration into separate CPPs and my
 compiler are GCC-3.4.6 on Gentoo. My registration strategy are next:
 
 1. In all of my classes, that I want to register in LUA, I create static
 member function called bind(). Its return an instance of class_ as
 described in documentation. For  example:
 
 //Class declaration
 using luabind::scope;
 class myclass {
 public:
     static scope bind(void);
 }
 
 //Class implementation
 scope myclass::bind(void) {
     using namespace luabind;
     return class_<myclass>("myclass")
        /*
           Properties and methods registering here
         */
        ;
 }
 
 
 2. in main registration unit I write next code:
 
 module(L) [
     class_1::bind(),
     class_2::bind(),
     class_3::bind()
     /*
        Other calls
     */
     class_last::bind()
 ];
 
 
 But when I register too many classes (more than 20) in main binding unit, it compiles
 successfully, but when I running my program, it fails code with
 segmentation fault. If I comments some calls to bind(), or, instead,
 comments some calls to .def, .property, .def_readwrite, .def_readonly in
 bind() class-methods, its work successfully. Its not good for me because
 I am want to bind large portion of engine classes to LUA.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Luabind cannot register too many classes?

Arvid Norberg-2
On Fri, Sep 29, 2006 at 03:25:32PM +0400, "??????? ?.?." wrote:

> I'm using the splitted class registration into separate CPPs and my
>  compiler are GCC-3.4.6 on Gentoo. My registration strategy are next:
> [...]
>  
>  2. in main registration unit I write next code:
>  
>  module(L) [
>      class_1::bind(),
>      class_2::bind(),
>      class_3::bind()
>      /*
>         Other calls
>      */
>      class_last::bind()
>  ];
>  
>  
>  But when I register too many classes (more than 20) in main binding unit, it compiles
>  successfully, but when I running my program, it fails code with
>  segmentation fault. If I comments some calls to bind(), or, instead,
>  comments some calls to .def, .property, .def_readwrite, .def_readonly in
>  bind() class-methods, its work successfully. Its not good for me because
>  I am want to bind large portion of engine classes to LUA.

That's strange. Maybe you can try to use multiple module() statements to see
if that helps. Unless you can figure out where it actually crashes.

--
Arvid Norberg

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

feature request: custom memory allocator

Dmitriy Iassenev
hello,

consider the following situation: some program product use lua with
luabind. Both libraries are built into the DLLs. Product part uses
luabind, client part uses luabind as well. Since product and client
may have different memory allocators, it is impossible to use luabind
without any change in such a scheme. So, every time we upgrade new
version of luabind we are to substitute its std containers and strings
with the std containers and strings with custom memory allocator,
which uses luabind::memory_allocator_function (realloc functionality)
for memory allocation/deallocation. There are several new/delete
operations in headers, which should use this allocator as well.

Feature request: make support of custom memory allocator in luabind.

P.S. I can send you the code we use for substitution.

--
Best regards,
 Dmitriy Iassenev
 GSC Game World
 [hidden email]



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user