Changeset 14583
- Timestamp:
- Jan 18, 2011, 5:11:44 PM (14 years ago)
- Location:
- trunk/source/lisp-kernel
- Files:
-
- 2 edited
-
pmcl-kernel.c (modified) (2 diffs)
-
windows-calls.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/lisp-kernel/pmcl-kernel.c
r14579 r14583 1710 1710 extern void init_winsock(void); 1711 1711 extern void init_windows_io(void); 1712 extern void reserve_tls_slots(void); 1712 1713 1713 1714 _fmode = O_BINARY; … … 1717 1718 init_winsock(); 1718 1719 init_windows_io(); 1720 reserve_tls_slots(); 1719 1721 utf_16_argv = CommandLineToArgvW(GetCommandLineW(),&wide_argc); 1720 1722 } -
trunk/source/lisp-kernel/windows-calls.c
r14012 r14583 1011 1011 } 1012 1012 1013 /* 1014 * Reserve TLS slots 32 through 63 in the TEB for (part of) the TCR. 1015 * 1016 * On Windows 7 x64, #_TlsAlloc returns 23 in a fresh lisp. On 1017 * Windows XP, it returns 11. With any luck, this will leave enough 1018 * wiggle room for the C runtime or whatever to use a few more TLS 1019 * slots, and still leave 32 through 63 free for us. 1020 */ 1021 void 1022 reserve_tls_slots() 1023 { 1024 unsigned int first_available, n, i; 1025 1026 first_available = TlsAlloc(); 1027 if (first_available > 32) { 1028 fprintf(dbgout, "Can't allocate required TLS indexes.\n"); 1029 fprintf(dbgout, "First available index value was %u\n", first_available); 1030 exit(1); 1031 } 1032 TlsFree(first_available); 1033 1034 for (i = first_available; i < 32; i++) { 1035 n = TlsAlloc(); 1036 if (n != i) { 1037 fprintf(dbgout, "unexpected TLS index value: wanted %u, got %u\n", i, n); 1038 exit(1); 1039 } 1040 } 1041 for (i = 32; i < 64; i++) { 1042 n = TlsAlloc(); 1043 if (n != i) { 1044 fprintf(dbgout, "unexpected TLS index value: wanted %u, got %u\n", i, n); 1045 exit(1); 1046 } 1047 } 1048 for (i = first_available; i < 32; i++) 1049 TlsFree(i); 1050 }
Note:
See TracChangeset
for help on using the changeset viewer.
