Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
d9d27c6e
Commit
d9d27c6e
authored
May 06, 1993
by
Kresten Krab Thorup
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
calloc -> __objc_xcalloc, bzero instances
From-SVN: r4351
parent
8d46dca5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
gcc/objc/class.c
+1
-1
gcc/objc/hash.c
+3
-3
gcc/objc/objects.c
+4
-1
No files found.
gcc/objc/class.c
View file @
d9d27c6e
...
@@ -226,7 +226,7 @@ I implement posing by hiding SUPER_CLASS, creating new class and meta class
...
@@ -226,7 +226,7 @@ I implement posing by hiding SUPER_CLASS, creating new class and meta class
Class
*
Class
*
class_pose_as
(
Class
*
impostor
,
Class
*
super_class
)
class_pose_as
(
Class
*
impostor
,
Class
*
super_class
)
{
{
Class
*
new_class
=
(
Class
*
)
calloc
(
1
,
sizeof
(
Class
));
Class
*
new_class
=
(
Class
*
)
__objc_x
calloc
(
1
,
sizeof
(
Class
));
MetaClass
*
new_meta_class
=
MetaClass
*
new_meta_class
=
(
MetaClass
*
)
__objc_xmalloc
(
sizeof
(
MetaClass
));
(
MetaClass
*
)
__objc_xmalloc
(
sizeof
(
MetaClass
));
char
*
new_name
=
(
char
*
)
__objc_xmalloc
((
size_t
)
strlen
((
char
*
)
super_class
->
name
)
+
12
);
char
*
new_name
=
(
char
*
)
__objc_xmalloc
((
size_t
)
strlen
((
char
*
)
super_class
->
name
)
+
12
);
...
...
gcc/objc/hash.c
View file @
d9d27c6e
...
@@ -51,13 +51,13 @@ hash_new (unsigned int size, hash_func_type hash_func,
...
@@ -51,13 +51,13 @@ hash_new (unsigned int size, hash_func_type hash_func,
/* Allocate the cache structure. calloc insures
/* Allocate the cache structure. calloc insures
its initialization for default values. */
its initialization for default values. */
cache
=
(
cache_ptr
)
calloc
(
1
,
sizeof
(
struct
cache
));
cache
=
(
cache_ptr
)
__objc_x
calloc
(
1
,
sizeof
(
struct
cache
));
assert
(
cache
);
assert
(
cache
);
/* Allocate the array of buckets for the cache.
/* Allocate the array of buckets for the cache.
calloc initializes all of the pointers to NULL. */
calloc initializes all of the pointers to NULL. */
cache
->
node_table
cache
->
node_table
=
(
node_ptr
*
)
calloc
(
size
,
sizeof
(
node_ptr
));
=
(
node_ptr
*
)
__objc_x
calloc
(
size
,
sizeof
(
node_ptr
));
assert
(
cache
->
node_table
);
assert
(
cache
->
node_table
);
cache
->
size
=
size
;
cache
->
size
=
size
;
...
@@ -96,7 +96,7 @@ void
...
@@ -96,7 +96,7 @@ void
hash_add
(
cache_ptr
*
cachep
,
const
void
*
key
,
void
*
value
)
hash_add
(
cache_ptr
*
cachep
,
const
void
*
key
,
void
*
value
)
{
{
size_t
indx
=
(
*
(
*
cachep
)
->
hash_func
)(
*
cachep
,
key
);
size_t
indx
=
(
*
(
*
cachep
)
->
hash_func
)(
*
cachep
,
key
);
node_ptr
node
=
(
node_ptr
)
calloc
(
1
,
sizeof
(
struct
cache_node
));
node_ptr
node
=
(
node_ptr
)
__objc_x
calloc
(
1
,
sizeof
(
struct
cache_node
));
assert
(
node
);
assert
(
node
);
...
...
gcc/objc/objects.c
View file @
d9d27c6e
...
@@ -41,7 +41,10 @@ class_create_instance(Class* class)
...
@@ -41,7 +41,10 @@ class_create_instance(Class* class)
if
(
CLS_ISCLASS
(
class
))
if
(
CLS_ISCLASS
(
class
))
new
=
(
*
_objc_object_alloc
)(
class
);
new
=
(
*
_objc_object_alloc
)(
class
);
if
(
new
!=
nil
)
if
(
new
!=
nil
)
new
->
class_pointer
=
class
;
{
bzero
(
new
,
class
->
instance_size
);
new
->
class_pointer
=
class
;
}
return
new
;
return
new
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment