* plugins/gtk/st/Gtk.st (main): create a process that does nothing. It will be only...
[syx.git] / syx / syx-object.h
blob789366cf3ec15051cdebb67427dbf65bd1d18923
1 /*
2 Copyright (c) 2007-2008 Luca Bruno
4 This file is part of Smalltalk YX.
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
25 #ifndef SYX_OBJECT_H
26 #define SYX_OBJECT_H
28 #include "syx-utils.h"
29 #include "syx-platform.h"
30 #include "syx-enums.h"
31 #include "syx-error.h"
32 #include "syx-init.h"
34 #include <stdlib.h>
35 #include <string.h>
37 #ifdef HAVE_LIBGMP
38 #include <gmp.h>
39 #endif
42 SYX_BEGIN_DECLS
44 #define SYX_OBJECT(oop) ((SyxObject *) (oop))
45 #define SYX_OBJECT_FLOAT(oop) (*((syx_double *)(SYX_OBJECT(oop)->data)))
47 #ifdef HAVE_LIBGMP
48 #define SYX_OBJECT_LARGE_INTEGER(oop) (*(mpz_t *)(SYX_OBJECT(oop)->data))
49 #endif
51 #define SYX_OBJECT_SYMBOL(oop) ((syx_symbol)(SYX_OBJECT(oop)->data))
52 #define SYX_OBJECT_STRING(oop) ((syx_string)(SYX_OBJECT(oop)->data))
53 #define SYX_OBJECT_BYTE_ARRAY(oop) ((syx_uint8 *)(SYX_OBJECT(oop)->data))
54 #define SYX_OBJECT_VARS(oop) (SYX_OBJECT(oop)->vars)
55 #define SYX_OBJECT_DATA_SIZE(oop) (SYX_OBJECT(oop)->data_size)
56 #define SYX_OBJECT_DATA(oop) (SYX_OBJECT(oop)->data)
57 #define SYX_OBJECT_HAS_REFS(oop) (SYX_OBJECT(oop)->has_refs)
58 #define SYX_OBJECT_IS_MARKED(oop) (SYX_OBJECT(oop)->is_marked)
59 #define SYX_OBJECT_IS_CONSTANT(oop) (SYX_OBJECT(oop)->is_constant)
61 #define SYX_IS_NIL(oop) ((oop) == 0 || (oop) == syx_nil)
62 #define SYX_IS_TRUE(oop) ((oop) == syx_true)
63 #define SYX_IS_FALSE(oop) ((oop) == syx_false)
64 #define SYX_IS_BOOLEAN(oop) (SYX_IS_TRUE(oop) || SYX_IS_FALSE(oop))
65 #define SYX_IS_OBJECT(oop) (SYX_IS_POINTER(oop) && \
66 (oop) >= (SyxOop)syx_memory && \
67 (oop) < (SyxOop)(syx_memory + _syx_memory_size))
68 #define SYX_IS_CPOINTER(oop) (SYX_IS_POINTER(oop) && \
69 ((oop) < (SyxOop)syx_memory || \
70 (oop) >= (SyxOop)(syx_memory + _syx_memory_size)))
72 #define SYX_OBJECT_IS_STRING(oop) (SYX_IS_OBJECT(oop) && SYX_OBJECT(oop)->klass == syx_string_class)
73 #define SYX_OBJECT_IS_SYMBOL(oop) (SYX_IS_OBJECT(oop) && SYX_OBJECT(oop)->klass == syx_symbol_class)
74 #define SYX_OBJECT_IS_FLOAT(oop) (SYX_IS_OBJECT(oop) && SYX_OBJECT(oop)->klass == syx_float_class)
75 #define SYX_OBJECT_IS_LARGE_INTEGER(oop) (SYX_IS_OBJECT(oop) && SYX_OBJECT(oop)->klass == syx_large_integer_class)
77 /* Oop */
79 typedef struct SyxObject SyxObject;
81 /*! The core class of Syx holding necessary informations for each concrete object. */
82 struct SyxObject
84 /*! Holds the class of the instance. Please use syx_object_get_class to obtain a class from a SyxOop */
85 SyxOop klass;
87 /*! Specify if this object contains references to other objects in its data */
88 syx_bool has_refs;
90 /*! Used to mark the object by the garbage collector */
91 syx_bool is_marked;
93 /*! Set to TRUE if data shouldn't be modified */
94 syx_bool is_constant;
96 /*! A list of SyxOop containing instance variables. */
97 SyxOop *vars;
99 /*! The number of data elements held by the object */
100 syx_varsize data_size;
102 /*! This holds the data stored for the object. These can be oops, bytes, doubles and so on. */
103 SyxOop *data;
106 extern EXPORT SyxObject *syx_memory;
107 extern EXPORT syx_int32 _syx_memory_size;
109 /*! Returns the index of the oop in the object table */
110 #define SYX_MEMORY_INDEX_OF(oop) ((((SyxOop)oop) - (SyxOop)syx_memory) / sizeof (SyxObject))
113 /* References to commonly used oops */
115 extern EXPORT SyxOop syx_nil,
116 syx_true,
117 syx_false,
119 syx_metaclass_class,
120 syx_undefined_object_class,
121 syx_true_class,
122 syx_false_class,
123 syx_small_integer_class,
124 syx_character_class,
125 syx_cpointer_class,
127 syx_large_integer_class,
128 syx_float_class,
129 syx_symbol_class,
130 syx_string_class,
131 syx_byte_array_class,
132 syx_array_class,
134 syx_variable_binding_class,
135 syx_dictionary_class,
137 syx_compiled_method_class,
138 syx_compiled_block_class,
139 syx_block_closure_class,
141 syx_method_context_class,
142 syx_block_context_class,
143 syx_process_class,
144 syx_processor_scheduler_class,
146 syx_symbols,
147 syx_globals;
149 EXPORT SyxOop syx_object_new_vars (SyxOop klass, syx_varsize vars_size);
150 #define syx_object_new(klass) (syx_object_new_vars ((klass), SYX_SMALL_INTEGER (SYX_CLASS_INSTANCE_SIZE ((klass)))))
151 EXPORT SyxOop syx_object_new_size (SyxOop klass, syx_bool has_refs, syx_varsize size);
152 EXPORT SyxOop syx_object_new_data (SyxOop klass, syx_bool has_refs, syx_varsize size, SyxOop *data);
153 EXPORT SyxOop syx_object_copy (SyxOop object);
154 EXPORT void syx_object_free (SyxOop oop);
155 EXPORT void syx_object_resize (SyxOop oop, syx_varsize size);
156 #define syx_object_grow_by(oop,size) (syx_object_resize((oop),SYX_OBJECT_DATA_SIZE(oop)+size))
157 EXPORT syx_int32 syx_object_get_variable_index (SyxOop self, syx_symbol name);
158 EXPORT void syx_object_initialize (SyxOop oop);
161 /*! Answer the hash of an Object */
162 INLINE syx_int32
163 syx_object_hash (SyxOop object)
165 /* distinguish between objects and embedded values */
166 if (SYX_IS_OBJECT (object))
167 return SYX_MEMORY_INDEX_OF (object);
169 /* i don't know how to hash C pointers sorry */
170 return SYX_SMALL_INTEGER_EMBED (object);
174 Get the class of an object.
176 \param object can be an SyxOop
177 \return For small integers return SmallInteger and for characters the Character class
179 INLINE SyxOop
180 syx_object_get_class (SyxOop object)
182 /* ordered by usage */
184 if (SYX_IS_OBJECT(object))
185 return SYX_OBJECT(object)->klass;
187 if (SYX_IS_SMALL_INTEGER(object))
188 return syx_small_integer_class;
190 if (SYX_IS_NIL(object))
191 return syx_undefined_object_class;
193 if (SYX_IS_CHARACTER(object))
194 return syx_character_class;
196 if (SYX_IS_CPOINTER(object))
197 return syx_cpointer_class;
199 syx_error ("unknown object\n");
200 return syx_nil;
206 Set the class of an object.
208 If the object is a constant, a small integer or a character, no operation is done
210 INLINE void
211 syx_object_set_class (SyxOop object, SyxOop klass)
213 if (!SYX_IS_OBJECT(object))
214 return;
216 SYX_OBJECT(object)->klass = klass;
219 EXPORT syx_symbol *syx_class_get_all_instance_variable_names (SyxOop klass);
220 EXPORT syx_bool syx_class_is_superclass_of (SyxOop klass, SyxOop subclass);
221 EXPORT SyxOop syx_class_lookup_method (SyxOop klass, syx_symbol selector);
222 EXPORT SyxOop syx_class_lookup_method_binding (SyxOop klass, SyxOop binding);
224 EXPORT syx_int32 syx_dictionary_index_of (SyxOop dict, syx_symbol key, syx_int32 hash, syx_bool return_nil_index);
225 EXPORT void syx_dictionary_rehash (SyxOop dict);
226 EXPORT SyxOop syx_dictionary_binding_at_symbol (SyxOop dict, syx_symbol key);
227 EXPORT SyxOop syx_dictionary_binding_at_symbol_if_absent (SyxOop dict, syx_symbol key, SyxOop object);
228 EXPORT SyxOop syx_dictionary_bind (SyxOop binding);
229 EXPORT void syx_dictionary_bind_set_value (SyxOop binding, SyxOop value);
230 EXPORT SyxOop syx_dictionary_at_symbol (SyxOop dict, syx_symbol key);
231 EXPORT SyxOop syx_dictionary_at_symbol_if_absent (SyxOop dict, syx_symbol key, SyxOop object);
232 EXPORT void syx_dictionary_at_symbol_put (SyxOop dict, SyxOop key, SyxOop value);
234 EXPORT syx_int32 syx_string_hash (syx_symbol string);
236 #define syx_symbol_hash(oop) (SYX_SMALL_INTEGER (SYX_SYMBOL_HASH (oop)))
238 /* Constructors */
240 EXPORT SyxOop syx_metaclass_new (SyxOop supermetaclass);
241 EXPORT SyxOop syx_class_new (SyxOop superclass);
242 EXPORT SyxOop syx_large_integer_new (syx_symbol string, syx_int32 base);
243 EXPORT SyxOop syx_large_integer_new_integer (syx_int32 integer);
244 EXPORT SyxOop syx_large_integer_new_mpz (syx_pointer mpz);
245 EXPORT SyxOop syx_symbol_new (syx_symbol symbol);
246 EXPORT SyxOop syx_method_context_new (SyxOop method, SyxOop receiver, SyxOop arguments);
247 EXPORT SyxOop syx_block_context_new (SyxOop block, SyxOop arguments);
248 EXPORT SyxOop syx_process_new (void);
250 EXPORT syx_bool syx_array_remove (SyxOop array, SyxOop element);
251 EXPORT void syx_array_add (SyxOop array, SyxOop element, syx_bool unique);
253 /* Accessors */
255 #define SYX_CLASS_NAME(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_CLASS_NAME])
256 #define SYX_CLASS_SUPERCLASS(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_CLASS_SUPERCLASS])
257 #define SYX_CLASS_INSTANCE_VARIABLES(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_CLASS_INSTANCE_VARIABLES])
258 #define SYX_CLASS_INSTANCE_SIZE(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_CLASS_INSTANCE_SIZE])
259 #define SYX_CLASS_METHODS(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_CLASS_METHODS])
260 #define SYX_CLASS_SUBCLASSES(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_CLASS_SUBCLASSES])
261 #define SYX_CLASS_FINALIZATION(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_CLASS_FINALIZATION])
263 #define SYX_METACLASS_INSTANCE_CLASS(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_METACLASS_INSTANCE_CLASS])
265 #define SYX_CLASS_CLASS_VARIABLES(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_CLASS_CLASS_VARIABLES])
267 #define SYX_SYMBOL_HASH(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_SYMBOL_HASH])
269 #define SYX_DICTIONARY_TALLY(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_DICTIONARY_TALLY])
271 #define SYX_ASSOCIATION_KEY(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_ASSOCIATION_KEY])
272 #define SYX_ASSOCIATION_VALUE(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_ASSOCIATION_VALUE])
274 #define SYX_VARIABLE_BINDING_DICTIONARY(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_VARIABLE_BINDING_DICTIONARY])
276 #define SYX_CODE_BYTECODES(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_CODE_BYTECODES])
277 #define SYX_CODE_ARGUMENTS_COUNT(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_CODE_ARGUMENTS_COUNT])
278 #define SYX_CODE_TEMPORARIES_COUNT(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_CODE_TEMPORARIES_COUNT])
279 #define SYX_CODE_LITERALS(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_CODE_LITERALS])
280 #define SYX_CODE_STACK_SIZE(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_CODE_STACK_SIZE])
281 #define SYX_CODE_PRIMITIVE(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_CODE_PRIMITIVE])
282 #define SYX_CODE_CLASS(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_CODE_CLASS])
283 #define SYX_CODE_TEXT(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_CODE_TEXT])
285 #define SYX_METHOD_ARGUMENT_STACK_SIZE(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_METHOD_ARGUMENT_STACK_SIZE])
286 #define SYX_METHOD_TEMPORARY_STACK_SIZE(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_METHOD_TEMPORARY_STACK_SIZE])
287 #define SYX_METHOD_SELECTOR(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_METHOD_SELECTOR])
288 #define SYX_METHOD_PRIMITIVE(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_METHOD_PRIMITIVE])
290 #define SYX_BLOCK_CLOSURE_BLOCK(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_BLOCK_CLOSURE_BLOCK])
291 #define SYX_BLOCK_CLOSURE_OUTER_FRAME(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_BLOCK_CLOSURE_OUTER_FRAME])
293 #define SYX_CONTEXT_PART_FRAME_POINTER(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_CONTEXT_PART_FRAME_POINTER])
294 #define SYX_CONTEXT_PART_STACK(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_CONTEXT_PART_STACK])
295 #define SYX_CONTEXT_PART_PARENT(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_CONTEXT_PART_PARENT])
296 #define SYX_CONTEXT_PART_METHOD(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_CONTEXT_PART_METHOD])
297 #define SYX_CONTEXT_PART_ARGUMENTS(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_CONTEXT_PART_ARGUMENTS])
299 #define SYX_METHOD_CONTEXT_RECEIVER(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_METHOD_CONTEXT_RECEIVER])
301 #define SYX_BLOCK_CONTEXT_CLOSURE(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_BLOCK_CONTEXT_CLOSURE])
302 #define SYX_BLOCK_CONTEXT_OUTER_CONTEXT(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_BLOCK_CONTEXT_OUTER_CONTEXT])
303 #define SYX_BLOCK_CONTEXT_HANDLED_EXCEPTION(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_BLOCK_CONTEXT_HANDLED_EXCEPTION])
304 #define SYX_BLOCK_CONTEXT_HANDLER_BLOCK(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_BLOCK_CONTEXT_HANDLER_BLOCK])
305 #define SYX_BLOCK_CONTEXT_ENSURE_BLOCK(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_BLOCK_CONTEXT_ENSURE_BLOCK])
307 #define SYX_PROCESS_STACK(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_PROCESS_STACK])
308 #define SYX_PROCESS_FRAME_POINTER(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_PROCESS_FRAME_POINTER])
309 #define SYX_PROCESS_SUSPENDED(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_PROCESS_SUSPENDED])
310 #define SYX_PROCESS_RETURNED_OBJECT(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_PROCESS_RETURNED_OBJECT])
311 #define SYX_PROCESS_NEXT(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_PROCESS_NEXT])
312 #define SYX_PROCESS_SCHEDULED(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_PROCESS_SCHEDULED])
314 #define SYX_PROCESSOR_SCHEDULER_ACTIVE_PROCESS(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_PROCESSOR_SCHEDULER_ACTIVE_PROCESS])
315 #define SYX_PROCESSOR_SCHEDULER_FIRST_PROCESS(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_PROCESSOR_SCHEDULER_FIRST_PROCESS])
316 #define SYX_PROCESSOR_SCHEDULER_BYTESLICE(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_PROCESSOR_SCHEDULER_BYTESLICE])
318 #define SYX_SEMAPHORE_LIST(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_SEMAPHORE_LIST])
319 #define SYX_SEMAPHORE_SIGNALS(oop) (SYX_OBJECT_VARS(oop)[SYX_VARS_SEMAPHORE_SIGNALS])
324 Returns the number of instance variables held by the object.
326 This method obtain the size of the instance from the instanceSize of its class
328 INLINE syx_varsize
329 syx_object_vars_size (SyxOop object)
331 SyxOop klass = syx_object_get_class (object);
332 return SYX_SMALL_INTEGER (SYX_CLASS_INSTANCE_SIZE (klass));
336 /* Inlined constructors */
339 /*! Create a Float object */
340 INLINE SyxOop
341 syx_float_new (syx_double floating)
343 SyxOop oop = syx_object_new_size (syx_float_class, FALSE, sizeof (syx_double));
344 SYX_OBJECT_FLOAT(oop) = floating;
345 return oop;
350 Creates a new ByteArray instance.
352 \param size the number of elements
353 \param data already initialized data for the byte array
355 INLINE SyxOop
356 syx_byte_array_new (syx_varsize size, syx_uint8 *data)
358 return syx_object_new_data (syx_byte_array_class, FALSE, size, (SyxOop *)data);
361 /*! Creates a new ByteArray instance with the given size */
362 INLINE SyxOop
363 syx_byte_array_new_size (syx_varsize size)
365 return syx_object_new_size (syx_byte_array_class, FALSE, size);
368 /*! Like syx_byte_array_new but duplicates the data */
369 INLINE SyxOop
370 syx_byte_array_new_ref (syx_varsize size, syx_uint8 *data)
372 SyxOop oop = syx_byte_array_new_size (size);
373 memcpy (SYX_OBJECT_DATA (oop), data, size * sizeof (syx_uint8));
374 return oop;
378 Creates a new Array instance.
380 \param size the number of elements
381 \param data already initialized data for the array
383 INLINE SyxOop
384 syx_array_new (syx_varsize size, SyxOop *data)
386 return syx_object_new_data (syx_array_class, TRUE, size, data);
389 /*! Creates a sized Array */
390 INLINE SyxOop
391 syx_array_new_size (syx_varsize size)
393 return syx_object_new_size (syx_array_class, TRUE, size);
396 /*! Like syx_array_new but duplicates the data */
397 INLINE SyxOop
398 syx_array_new_ref (syx_varsize size, SyxOop *data)
400 SyxOop oop = syx_array_new_size (size);
401 memcpy (SYX_OBJECT_DATA(oop), data, size * sizeof (SyxOop));
402 return oop;
406 /*! Returns a new String instance. Duplicates the string in input.
408 Use of variadic arguments is allowed to create a new string like using sprintf.
410 INLINE SyxOop
411 syx_string_new (syx_symbol string, ...)
413 syx_string new_string;
414 SYX_VSPRINTF (string, new_string);
415 if (!new_string)
416 return syx_nil;
418 return syx_object_new_data (syx_string_class, FALSE, strlen (string) + 1, (SyxOop *)new_string);
421 /*! Returns a new String instance. */
422 INLINE SyxOop
423 syx_string_new_ref (syx_string string)
425 if (!string)
426 return syx_nil;
428 return syx_object_new_data (syx_string_class, FALSE, strlen (string) + 1, (SyxOop *)string);
431 /*! Creates a new VariableBinding key -> index on a dictionary */
432 INLINE SyxOop
433 syx_variable_binding_new (SyxOop key, syx_int32 index, SyxOop dictionary)
435 SyxOop object = syx_object_new (syx_variable_binding_class);
436 SYX_ASSOCIATION_KEY(object) = key;
437 SYX_ASSOCIATION_VALUE(object) = syx_small_integer_new (index);
438 SYX_VARIABLE_BINDING_DICTIONARY(object) = dictionary;
439 return object;
443 Creates a new Semaphore and initializes it from Smalltalk itself.
445 INLINE SyxOop
446 syx_semaphore_new (void)
448 SyxOop object = syx_object_new (syx_globals_at ("Semaphore"));
449 syx_object_initialize (object);
450 return object;
454 Creates a new dictionary and its hash table.
456 The effective size of the hash table is size * 2
458 INLINE SyxOop
459 syx_dictionary_new (syx_varsize size)
461 SyxOop dict = syx_object_new_size (syx_dictionary_class, TRUE, size * 2);
462 SYX_DICTIONARY_TALLY (dict) = syx_small_integer_new (0);
463 return dict;
467 Create a new BlockClosure.
469 \param block a CompiledBlock
471 INLINE SyxOop
472 syx_block_closure_new (SyxOop block)
474 SyxOop object = syx_object_new (syx_block_closure_class);
475 SYX_BLOCK_CLOSURE_BLOCK(object) = block;
476 return object;
480 /*! Create a new raw CompiledMethod */
481 #define syx_method_new() (syx_object_new (syx_compiled_method_class))
483 /*! Create a new raw CompiledBlock */
484 #define syx_block_new() (syx_object_new (syx_compiled_block_class))
486 SYX_END_DECLS
488 #endif /* SYX_OBJECT_H */