[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Maximum number of user-data
- From: "Zé Pedro" <zarroba@...>
- Date: Sat, 10 Feb 2007 15:30:21 +0000
I'm sorry to insist in this question but I'm really stuck in here. I have 27 types of data that I want to export to lua from C++. Everything was working until I defined my 18th data type. When I try to execute a script my program crashes with core dump while trying to reallocate memory. Here is the error:
*** glibc detected *** realloc(): invalid next size: 0xb4a0fcd8 ***
If I comment one data type definition the program doesn't crashes. Any idea on how to solve this problem?
Thanks,
José Tavares
On 2/8/07,
Zé Pedro <zarroba@gmail.com> wrote:
Hi all..
I have a question about how many user-defined types can be registered in lua (or the size of memory allocated for it). I'm at a point when I register any more types there is a realloc exception when trying to execute a lua script. Have I reached the memory limit of data types registered?
Another problem I'm having is making variables that I pass from C to lua read only. I'm registering a variable that can be of one of three types defined by me. When adding it to the stack before I execute the script I've tried to redefine the "__newindex" field so the variable cannot be changed. But this isn't working. From what I understood I could only do this before I registered it. Any ideas?
Thanks,
José Tavares
--
Believe nothing, no matter where you read it, or who said it,
no matter if I have said it, unless it agrees with your own reason
and your common sense.
- Buda
Para quê ter olhos azuis, se a Natureza deixa os meus vermelhos?
- Bob Marley
"Don't try to use what you learn from Buddhism to be a Buddhist;
use it to be a better whatever-you-already-are."
- His Holiness the 14th Dalai Lama
Idealism is what precedes experience; cynicism is what follows.
- David T. Wolf
"Please don't download, because I want to get a pool in my second home."
- Kanye West
--
Believe nothing, no matter where you read it, or who said it,
no matter if I have said it, unless it agrees with your own reason
and your common sense.
- Buda
Para quê ter olhos azuis, se a Natureza deixa os meus vermelhos?
- Bob Marley
"Don't try to use what you learn from Buddhism to be a Buddhist;
use it to be a better whatever-you-already-are."
- His Holiness the 14th Dalai Lama
Idealism is what precedes experience; cynicism is what follows.
- David T. Wolf
"Please don't download, because I want to get a pool in my second home."
- Kanye West