Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (17 sloc) 365 Bytes
#include "object.h"
#include "mem.h"
#include "intcache.h"
object* make_fixnum(long value) {
object *obj;
obj = intcache_get(value);
if (obj != NULL) {
return obj;
}
obj = alloc_object();
type(obj) = FIXNUM;
obj_nv(obj) = value;
return obj;
}
int is_fixnum(object *obj) {
return obj != NULL && type(obj) == FIXNUM;
}