2 #include "structdefs.h"
3 extern int classsize[];
6 #define FREEMALLOC(x) GC_malloc(x)
8 #define FREEMALLOC(x) calloc(1,x)
11 int ___Object______hashcode____(struct ___Object___ * ___this___) {
12 return (int) ___this___;
15 void ___System______printInt____I(int x) {
19 void ___System______printString____L___String___(struct ___String___ * s) {
20 struct ArrayObject * chararray=s->___string___;
22 for(i=0;i<chararray->___length___;i++) {
23 short s= ((short *)(((char *)& chararray->___length___)+sizeof(int)))[i];
29 void * allocate_new(int type) {
30 void * v=FREEMALLOC(classsize[type]);
35 void * allocate_newarray(int type, int length) {
36 void * v=FREEMALLOC(sizeof(struct ArrayObject)+length*classsize[type]);
38 ((struct ArrayObject *)v)->___length___=length;
42 struct ___String___ * NewString(char *str,int length) {
43 struct ArrayObject * chararray=allocate_newarray(CHARARRAYTYPE, length);
44 struct ___String___ * strobj=allocate_new(STRINGTYPE);
46 strobj->___string___=chararray;
47 for(i=0;i<length;i++) {
48 ((short *)(((char *)& chararray->___length___)+sizeof(int)))[i]=(short)str[i]; }