/* Object allocation function */
#ifdef DSTM
-void * allocate_newglobal(transrecord_t *trans, int type) {
+__attribute__((malloc)) void * allocate_newglobal(transrecord_t *trans, int type) {
struct ___Object___ * v=(struct ___Object___ *) transCreateObj(trans, classsize[type]);
v->type=type;
#ifdef THREADS
/* Array allocation function */
-struct ArrayObject * allocate_newarrayglobal(transrecord_t *trans, int type, int length) {
+__attribute__((malloc)) struct ArrayObject * allocate_newarrayglobal(transrecord_t *trans, int type, int length) {
struct ArrayObject * v=(struct ArrayObject *)transCreateObj(trans, sizeof(struct ArrayObject)+length*classsize[type]);
if (length<0) {
printf("ERROR: negative array\n");
#ifdef PRECISE_GC
-void * allocate_new(void * ptr, int type) {
+__attribute__((malloc)) void * allocate_new(void * ptr, int type) {
struct ___Object___ * v=(struct ___Object___ *) mygcmalloc((struct garbagelist *) ptr, classsize[type]);
v->type=type;
#ifdef THREADS
/* Array allocation function */
-struct ArrayObject * allocate_newarray(void * ptr, int type, int length) {
+__attribute__((malloc)) struct ArrayObject * allocate_newarray(void * ptr, int type, int length) {
struct ArrayObject * v=mygcmalloc((struct garbagelist *) ptr, sizeof(struct ArrayObject)+length*classsize[type]);
v->type=type;
if (length<0) {
/* Array allocation function */
__attribute__((malloc)) struct ArrayObject * allocate_newarray(int type, int length) {
- struct ArrayObject * v=FREEMALLOC(sizeof(struct ArrayObject)+length*classsize[type]);
+ __attribute__((malloc)) struct ArrayObject * v=FREEMALLOC(sizeof(struct ArrayObject)+length*classsize[type]);
v->type=type;
v->___length___=length;
#ifdef OPTIONAL
/* Converts C character arrays into Java strings */
#ifdef PRECISE_GC
-struct ___String___ * NewString(void * ptr, const char *str,int length) {
+__attribute__((malloc)) struct ___String___ * NewString(void * ptr, const char *str,int length) {
#else
__attribute__((malloc)) struct ___String___ * NewString(const char *str,int length) {
#endif
#endif
#ifdef DSTM
-void * allocate_newglobal(transrecord_t *, int type);
-struct ArrayObject * allocate_newarrayglobal(transrecord_t *, int type, int length);
+__attribute__((malloc)) void * allocate_newglobal(transrecord_t *, int type);
+__attribute__((malloc)) struct ArrayObject * allocate_newarrayglobal(transrecord_t *, int type, int length);
#endif
#ifdef PRECISE_GC
#include "garbage.h"
-void * allocate_new(void *, int type);
-struct ArrayObject * allocate_newarray(void *, int type, int length);
-struct ___String___ * NewString(void *, const char *str,int length);
-struct ___TagDescriptor___ * allocate_tag(void *ptr, int index);
+__attribute__((malloc)) void * allocate_new(void *, int type);
+__attribute__((malloc)) struct ArrayObject * allocate_newarray(void *, int type, int length);
+__attribute__((malloc)) struct ___String___ * NewString(void *, const char *str,int length);
+__attribute__((malloc)) struct ___TagDescriptor___ * allocate_tag(void *ptr, int index);
#else
__attribute__((malloc)) void * allocate_new(int type);
__attribute__((malloc)) struct ArrayObject * allocate_newarray(int type, int length);
__attribute__((malloc)) struct ___String___ * NewString(const char *str,int length);
-struct ___TagDescriptor___ * allocate_tag(int index);
+__attribute__((malloc)) struct ___TagDescriptor___ * allocate_tag(int index);
#endif