Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] struct sizes hardcoded?

>>>>> "Seth" == Seth Nickell <snickell@xxxxxxxxxxxx> writes:

>> public static final int sizeof = OS.sizeof ("GdkColor");

Seth> I didn't think sizeof took a string? I don't know of a wayy in
Seth> JNI to pass the actual type to a native function (not saying
Seth> there's not one, only that I couldn't find it ;-), so unless JNI
Seth> includes some sort of mechanism for getting "sizeof", native
Seth> calls to every type you want to get the size of are necessary.

In my scheme you'd need a table mapping type names to sizes.  Your
suggestion of having a separate native method for each type is pretty
much the same idea.  It is just implemented a bit differently.  For my
current purposes (estimating the amount of work involved), this detail
seems unimportant.

Tom


Back to the top