comparison runtime/builtin.c @ 141:f2cb85c53ced

Fix Pause/Resume and rewrite Call Async in Rhope rather than C
author Mike Pavone <pavone@retrodev.com>
date Sat, 20 Nov 2010 17:48:22 -0500
parents c14698c512f1
children ba35ab624ec2
comparison
equal deleted inserted replaced
140:c14698c512f1 141:f2cb85c53ced
1 #include "builtin.h" 1 #include "builtin.h"
2 #include "object.h" 2 #include "object.h"
3 #include "integer.h" 3 #include "integer.h"
4 #include "bool.h" 4 #include "bool.h"
5 #include "context.h"
5 #include <stddef.h> 6 #include <stddef.h>
6 #include <stdio.h> 7 #include <stdio.h>
7 #include <stdlib.h> 8 #include <stdlib.h>
8 #include <string.h> 9 #include <string.h>
9 #include <stdarg.h> 10 #include <stdarg.h>
119 t_Boolean * b = (t_Boolean *)new_object(TYPE_BOOLEAN); 120 t_Boolean * b = (t_Boolean *)new_object(TYPE_BOOLEAN);
120 b->Val = val != 0; 121 b->Val = val != 0;
121 return (object*)b; 122 return (object*)b;
122 } 123 }
123 124
125 object * make_Context(context * ct)
126 {
127 t_Context * c = (t_Context *)new_object(TYPE_CONTEXT);
128 c->ct = ct;
129 return (object *)c;
130 }
131
124 object * make_Worker(int32_t index, int16_t initialsize, int16_t initialcount) 132 object * make_Worker(int32_t index, int16_t initialsize, int16_t initialcount)
125 { 133 {
126 t_Worker * worker = (t_Worker *)_internal_worker_alloc(initialsize); 134 t_Worker * worker = (t_Worker *)_internal_worker_alloc(initialsize);
127 worker->payload.Index = index; 135 worker->payload.Index = index;
128 worker->payload.Count = initialcount; 136 worker->payload.Count = initialcount;