[LUAU] programming question, buffer problem?

Charles Lockhart lockhart at IfA.Hawaii.Edu
Thu Dec 30 11:39:33 PST 2004


The retard factor is kicking in on me today.

I have a program that uses quite a bit of buffer space.  There are four 
major chunks of buffer space, three declared something like "short 
mybuffer[32][4M]", and the fourth "int myotherbuffer[4][4M]".  Total 
buffer usage comes in at somewhere under 800MB.

In the previous iteration of the program, the data chunks were smaller 
(1M instead of 4M), and it worked fine, never saw a problem.  But now 
I'm seeing a segmentation fault as soon as I start the program.

If I change the 32 to 30, it seems to run fine.

Now, I've seen this happen when you declare to large a chunk of data in 
a function, where I think basically the stack barfs and you get a 
segmentation fault because the data didn't fit.  But these buffers are 
declared in a header file, and I *thought* that meant they'd be loaded 
to the heap, and not have the same problem.

I kind of remember from somewhere that if you try to load a program that 
requires greater than half the available heap then this'll happen, but 
I've got 3GB of ram on this machine, and without this program running, 
I'm only using about 700MB.  So that *shouldn't* be it, at least as I 
understand it.

Any ideas?  I could live with 30 buffers per ring, but since I don't 
know what the real problem is, I don't know if that's even a solution.

Thanks in advance,

-Charles





More information about the LUAU mailing list