[Openmcl-cvs-notifications] r10933 - /trunk/source/lisp-kernel/thread_manager.c

gb at clozure.com gb at clozure.com
Tue Sep 30 20:12:57 EDT 2008


Author: gb
Date: Tue Sep 30 20:12:56 2008
New Revision: 10933

Log:
Work around win32 malloc alignment limitations when allocating tcr,,
using tcr.allocated.

Modified:
    trunk/source/lisp-kernel/thread_manager.c

Modified: trunk/source/lisp-kernel/thread_manager.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/thread_manager.c (original)
+++ trunk/source/lisp-kernel/thread_manager.c Tue Sep 30 20:12:56 2008
@@ -758,6 +758,17 @@
   UNLOCK(lisp_global(TCR_AREA_LOCK),new);
 }
 =

+#ifdef WIN_32
+TCR *
+allocate_tcr()
+{
+  void *p =3D calloc(1,sizeof(TCR)+15);
+  TCR *tcr =3D (TCR *)((((natural)p)+15)&~15);
+
+  tcr->allocated =3D p;
+  return tcr;
+}
+#else
 TCR *
 allocate_tcr()
 {
@@ -801,6 +812,7 @@
     return tcr;
   }
 }
+#endif
 =

 #ifdef X8664
 #ifdef LINUX
@@ -1931,7 +1943,11 @@
   for (current =3D freed_tcrs; current; current =3D next) {
     next =3D current->next;
 #ifndef HAVE_TLS
+#ifdef WIN32
+    free(current->allocated);
+#else
     free(current);
+#endif
 #endif
   }
   freed_tcrs =3D NULL;



More information about the Openmcl-cvs-notifications mailing list