mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-14 08:17:35 +02:00
Force inlining of Cyc_is_null
By redefining as a macro there is a large potential speed increase with certain programs, with very few changes on our end.
This commit is contained in:
parent
9c1ea32be0
commit
44c246c38e
3 changed files with 10 additions and 9 deletions
|
@ -440,9 +440,8 @@ int equal(object, object);
|
|||
object equalp(object, object);
|
||||
object Cyc_has_cycle(object lst);
|
||||
object Cyc_is_boolean(object o);
|
||||
//object Cyc_is_pair(object o);
|
||||
#define Cyc_is_pair(o) ((is_object_type(o) && ((list) o)->tag == pair_tag) ? boolean_t : boolean_f)
|
||||
object Cyc_is_null(object o);
|
||||
#define Cyc_is_null(o) make_boolean(o == NULL)
|
||||
object Cyc_is_number(object o);
|
||||
object Cyc_is_complex(object o);
|
||||
object Cyc_is_real(object o);
|
||||
|
|
|
@ -626,6 +626,8 @@ typedef boolean_type *boolean;
|
|||
|
||||
#define boolean_desc(x) (((boolean_type *) x)->desc)
|
||||
|
||||
#define make_boolean(x) (x ? boolean_t : boolean_f)
|
||||
|
||||
/**
|
||||
* @brief Symbols are similar to strings, but only one instance of each
|
||||
* unique symbol is created, so comparisons are O(1).
|
||||
|
|
14
runtime.c
14
runtime.c
|
@ -1557,13 +1557,13 @@ object Cyc_is_boolean(object o)
|
|||
// return boolean_t;
|
||||
// return boolean_f;
|
||||
//}
|
||||
|
||||
object Cyc_is_null(object o)
|
||||
{
|
||||
if (o == NULL)
|
||||
return boolean_t;
|
||||
return boolean_f;
|
||||
}
|
||||
//
|
||||
//object Cyc_is_null(object o)
|
||||
//{
|
||||
// if (o == NULL)
|
||||
// return boolean_t;
|
||||
// return boolean_f;
|
||||
//}
|
||||
|
||||
object Cyc_is_number(object o)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue