apnadkarni / tcl-cffi

A Foreign Function Interface extension for Tcl
BSD 2-Clause "Simplified" License
14 stars 2 forks source link

Reduce memory requirements by sharing type information #33

Open apnadkarni opened 3 years ago

apnadkarni commented 3 years ago

The type information blocks should be shared among declarations. For example, every "int" need not get its own block unless attributes are different. Ditto for type aliases - reuse unless modified.

apnadkarni commented 1 year ago

Also consider caching the usability of that type for each context (param, field, return) within the type structure so it is not recomputed unless other annotations are added.

apnadkarni commented 10 months ago

Perhaps define a Tcl_Obj type that holds a type definition.

apnadkarni commented 6 months ago

Several implementation possibilities: