case _B_SSTR:
{
int length = buf[0]&_B_VALUE;
- (*string) = (char*)__objc_xmalloc(length+1);
+ (*string) = (char*)objc_malloc(length+1);
if (key)
hash_add (&stream->stream_table, LONG2PTR(key), *string);
len = (*stream->read)(stream->physical, *string, length);
char *tmp;
len = __objc_read_nbyte_ulong(stream, (buf[0] & _B_VALUE), &key);
tmp = hash_value_for_key (stream->stream_table, LONG2PTR (key));
- *string = __objc_xmalloc (strlen(tmp) + 1);
+ *string = objc_malloc (strlen(tmp) + 1);
strcpy (*string, tmp);
}
break;
unsigned int nbytes = buf[0]&_B_VALUE;
len = __objc_read_nbyte_uint(stream, nbytes, &nbytes);
if (len) {
- (*string) = (char*)__objc_xmalloc(nbytes+1);
+ (*string) = (char*)objc_malloc(nbytes+1);
if (key)
hash_add (&stream->stream_table, LONG2PTR(key), *string);
len = (*stream->read)(stream->physical, *string, nbytes);
/* get class */
len = objc_read_string (stream, &class_name);
(*class) = objc_get_class(class_name);
- free (class_name);
+ objc_free(class_name);
/* register */
if (key)
}
else
(*selector) = sel_get_any_uid(selector_name);
- free (selector_name);
+ objc_free(selector_name);
/* register */
if (key)
return 1;
}
-static void
-__objc_free (void* p)
-{
- free (p);
-}
-
static int
__objc_fread(FILE* file, char* data, int len)
{
reflist = reflist->tail;
}
}
- list_mapcar (free_list, __objc_free);
+ list_mapcar (free_list, objc_free);
list_free (free_list);
/* empty object reference table */
TypedStream*
objc_open_typed_stream (FILE* physical, int mode)
{
- TypedStream* s = (TypedStream*)__objc_xmalloc(sizeof(TypedStream));
+ TypedStream* s = (TypedStream*)objc_malloc(sizeof(TypedStream));
s->mode = mode;
s->physical = physical;
if (stream->type == (OBJC_MANAGED_STREAM | OBJC_FILE_STREAM))
fclose ((FILE*)stream->physical);
- free (stream);
+ objc_free(stream);
}
BOOL