summaryrefslogtreecommitdiffstatshomepage
path: root/unix/ffi.c
Commit message (Collapse)AuthorAge
* unix: Rename module sources per latest naming conventions (mod*.c).Paul Sokolovsky2014-04-04
|
* Merge map.h into obj.h.Damien George2014-03-30
| | | | | | Pretty much everyone needs to include map.h, since it's such an integral part of the Micro Python object implementation. Thus, the definitions are now in obj.h instead. map.h is removed.
* Rename rt_* to mp_*.Damien George2014-03-30
| | | | | | | Mostly just a global search and replace. Except rt_is_true which becomes mp_obj_is_true. Still would like to tidy up some of the names, but this will do for now.
* unix: Fix ffi.c to compile with latest changes to API.Damien George2014-03-29
|
* py: Rename old const type objects to mp_type_* for consistency.Damien George2014-03-29
|
* Remove mp_obj_type_t.methods entry and use .locals_dict instead.Damien George2014-03-26
| | | | | | | | | | | | | | | | | | | | | | Originally, .methods was used for methods in a ROM class, and locals_dict for methods in a user-created class. That distinction is unnecessary, and we can use locals_dict for ROM classes now that we have ROMable maps. This removes an entry in the bloated mp_obj_type_t struct, saving a word for each ROM object and each RAM object. ROM objects that have a methods table (now a locals_dict) need an extra word in total (removed the methods pointer (1 word), no longer need the sentinel (2 words), but now need an mp_obj_dict_t wrapper (4 words)). But RAM objects save a word because they never used the methods entry. Overall the ROM usage is down by a few hundred bytes, and RAM usage is down 1 word per user-defined type/class. There is less code (no need to check 2 tables), and now consistent with the way ROM modules have their tables initialised. Efficiency is very close to equivaluent.
* Implement proper exception type hierarchy.Damien George2014-02-15
| | | | | | | | | | | | | | Each built-in exception is now a type, with base type BaseException. C exceptions are created by passing a pointer to the exception type to make an instance of. When raising an exception from the VM, an instance is created automatically if an exception type is raised (as opposed to an exception instance). Exception matching (RT_BINARY_OP_EXCEPTION_MATCH) is now proper. Handling of parse error changed to match new exceptions. mp_const_type renamed to mp_type_type for consistency.
* ffi: Implement ffivar.get()/set() methods.Paul Sokolovsky2014-02-14
| | | | | Done by introducing another factored out helper API in binary.c. This API can be reused also by array and struct modules.
* ffi: Fix mp_obj_str_get_data() return type.Paul Sokolovsky2014-02-08
|
* unix: Fix compile warnings for ffi module on 64-bit machine.Damien George2014-01-28
|
* unix: Initial implementation of FFI module.Paul Sokolovsky2014-01-29
Foreign Function Interface module allows to load native dynamic libraries, call functions and access variables in them. This makes possible to write interface modules in pure Python. This module provides thin wrapper around libffi. ctypes compatibility might be possible to implement on top of this module (though ctypes allow to call functions without prototypes, which is not supported by libffi (i.e. implementation would be inefficient))).