Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LSH
lsh
Commits
2af5d720
Commit
2af5d720
authored
Jan 21, 2002
by
Niels Möller
Browse files
(lsh_list_alloc): Moved fucntion here, from xalloc.c.
Now uses lsh_var_alloc. Rev: src/list.c:1.8
parent
0b0d6c10
Changes
1
Show whitespace changes
Inline
Side-by-side
src/list.c
View file @
2af5d720
...
...
@@ -34,7 +34,29 @@
#include "xalloc.h"
struct
int_list
*
make_int_listv
(
unsigned
n
,
va_list
args
)
struct
list_header
*
lsh_list_alloc
(
struct
lsh_class
*
class
,
unsigned
length
,
size_t
element_size
)
{
/* FIXME: When gaba.scm is fixed to use offsetof instead of sizeof,
* the size calculation below must be updated as well. */
struct
list_header
*
list
;
assert
(
element_size
<
1024
);
list
=
(
struct
list_header
*
)
lsh_var_alloc
(
class
,
class
->
size
+
element_size
*
length
-
element_size
);
CHECK_SUBTYPE
(
list_header
,
list
);
list
->
length
=
length
;
return
list
;
}
struct
int_list
*
make_int_listv
(
unsigned
n
,
va_list
args
)
{
unsigned
i
;
...
...
@@ -52,7 +74,8 @@ struct int_list *make_int_listv(unsigned n, va_list args)
return
l
;
}
struct
int_list
*
make_int_list
(
unsigned
n
,
...)
struct
int_list
*
make_int_list
(
unsigned
n
,
...)
{
va_list
args
;
struct
int_list
*
l
;
...
...
@@ -64,7 +87,8 @@ struct int_list *make_int_list(unsigned n, ...)
return
l
;
}
struct
object_list
*
make_object_listv
(
unsigned
n
,
va_list
args
)
struct
object_list
*
make_object_listv
(
unsigned
n
,
va_list
args
)
{
unsigned
i
;
...
...
@@ -79,8 +103,8 @@ struct object_list *make_object_listv(unsigned n, va_list args)
return
l
;
}
struct
object_list
*
make_object_list
(
unsigned
n
,
...)
struct
object_list
*
make_object_list
(
unsigned
n
,
...)
{
va_list
args
;
struct
object_list
*
l
;
...
...
@@ -91,4 +115,3 @@ struct object_list *make_object_list(unsigned n, ...)
return
l
;
}
Write
Preview
Supports
Markdown
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