>>>>> "P" == Paul Brannan <pbrannan / atdesk.com> writes:

P> The original problem Jamis pointed out is that the number of callbacks
P> is limited when dl is compiled (they are statically defined in
P> callback.func).  There is a compile-time limited number of return types
P> and a compile-time limited number of callbacks per return type.

 Look at callback.func and see the difference between
 rb_dl_callback_func_0_0() and rb_dl_callback_func_0_1() 

 One has

  obj = rb_hash_aref(DLFuncTable, rb_assoc_new(INT2NUM(0),INT2NUM(0)));

 The other

  obj = rb_hash_aref(DLFuncTable, rb_assoc_new(INT2NUM(0),INT2NUM(1)));

 and you have the limitation, based on the hash just to retrieve this
 information 

  proto = rb_ary_entry(obj, 0);
  proc  = rb_ary_entry(obj, 1);


P> If it were possible to dynamically generate C functions, there would be
P> no limitation, and the only way I know to get rid of the limitation is
P> to dynamically generate C functions.

 There is another way to do it. Just imagine that `proc' and `proto' are
 given as arguments to these functions, and you have solved the problem.



Guy Decoux