Re: CTID_MAX limit

  • From: Konstantin Olkhovskiy <lupus@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sat, 25 May 2013 13:52:22 +0400

As far as i can see CTID_MAX is quite generous.

For our needs I've developed some quick&dirty perl script that runs the
required header files via '${CC} -E'.
Given that we include quite a lot of system headers we reached only like
5k types (estimated based on the last error I saw from one of top header
files, complaining that I'm trying to call anonymous union ##).

So most likely you're doing something wrong (as Mike already pointed out...)

(I can share the script if some one needs it by the way. Quite handy to keep
cdefs in sync with actual headers.)

2013/5/25 Mike Pall <mike-1305@xxxxxxxxxx>

> Wesley Smith wrote:
> > I've run into problems with the CTID_MAX limit while using LuaJIT.
>
> The limit is fixed and cannot be changed without a major rewrite.
>
> If you're bumping into the limit because of including too many
> headers, try to reduce them to the declarations you really need.
>
> If you've declared too many data types dynamically, then you need
> to check your code. A common cause is creating unnamed structs in
> a loop (e.g. ffi.new("struct {...}")). This declares a distinct
> data type on every invocation, which is usually not what you want.
>
> --Mike
>
>


-- 
Regards,
Konstantin

Other related posts: