gcl.git - GNU Common Lisp

index : gcl.git
GNU Common Lisp
summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamm Maguire <camm@debian.org>2015年02月05日 10:38:20 -0500
committerCamm Maguire <camm@debian.org>2015年02月05日 10:38:20 -0500
commit5960dc3dba1a83bd3ecd089c261e69ca7c7eb226 (patch)
treef482c841bc2c09181cde3b529868e186ce8744e1
parent7510123ef646a22d6bcf59b206b58659bca1a657 (diff)
downloadgcl-5960dc3dba1a83bd3ecd089c261e69ca7c7eb226.tar.gz
make_cons via alloc_object
Diffstat
-rw-r--r--gcl/o/alloc.c 39
1 files changed, 35 insertions, 4 deletions
diff --git a/gcl/o/alloc.c b/gcl/o/alloc.c
index 996718f8a..ccb69a80d 100644
--- a/gcl/o/alloc.c
+++ b/gcl/o/alloc.c
@@ -485,6 +485,8 @@ Use ALLOCATE to expand the space.",
#endif
bool prefer_low_mem_contblock=FALSE;
+DEFVAR("*STATIC-RELOCATABLE-BUFFER*",sSAstatic_relocatable_bufferA,SI,sLnil,"");
+
inline void *
alloc_from_freelist(struct typemanager *tm,fixnum n) {
@@ -522,6 +524,13 @@ alloc_from_freelist(struct typemanager *tm,fixnum n) {
break;
default:
+ if (tm==tm_table+t_cons && sSAstatic_relocatable_bufferA && sSAstatic_relocatable_bufferA->s.s_dbind!=Cnil) {
+ if (sSAstatic_relocatable_bufferA->s.s_dbind->v.v_fillp==sSAstatic_relocatable_bufferA->s.s_dbind->v.v_dim/2)
+ return NULL;
+ p=sSAstatic_relocatable_bufferA->s.s_dbind->v.v_self+sSAstatic_relocatable_bufferA->s.s_dbind->v.v_fillp;
+ sSAstatic_relocatable_bufferA->s.s_dbind->v.v_fillp+=sizeof(struct cons)/sizeof(object);
+ return p;
+ }
if ((p=tm->tm_free)!=OBJNULL) {
tm->tm_free = OBJ_LINK(p);
tm->tm_nfree--;
@@ -761,16 +770,38 @@ load_cons(object p,object a,object d) {
p->c.c_car=a;
}
+/* inline object */
+/* make_cons(object a,object d) { */
+
+/* static struct typemanager *tm=tm_table+t_cons;/\*FIXME*\/ */
+/* object obj=alloc_mem(tm,tm->tm_size); */
+
+/* load_cons(obj,a,d); */
+
+/* pageinfo(obj)->in_use++; */
+
+/* return(obj); */
+
+/* } */
+
+/* inline object */
+/* make_cons(object a,object d) { */
+
+/* object obj=alloc_relblock(sizeof(struct cons)); */
+
+/* load_cons(obj,a,d); */
+
+/* return(obj); */
+
+/* } */
+
inline object
make_cons(object a,object d) {
- static struct typemanager *tm=tm_table+t_cons;/*FIXME*/
- object obj=alloc_mem(tm,tm->tm_size);
+ object obj=alloc_object(t_cons);
load_cons(obj,a,d);
- pageinfo(obj)->in_use++;
-
return(obj);
}
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月09日 00:39:36 +0000

AltStyle によって変換されたページ (->オリジナル) /