This repository was archived by the owner on Oct 12, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +45
-4
lines changed Expand file tree Collapse file tree 3 files changed +45
-4
lines changed Original file line number Diff line number Diff line change 1
- the garbage collector is now lazily initialized on first use
1
+ The garbage collector is now lazily initialized on first use
2
2
3
3
The runtime now lazily initializes the GC on first use, thus allowing applications that do not use the GC to skip its initialization.
Original file line number Diff line number Diff line change @@ -1010,14 +1010,16 @@ void __delete(T)(ref T x) @system
1010
1010
static assert (0 , " It is not possible to delete: `" ~ T.stringof ~ " `" );
1011
1011
}
1012
1012
1013
- static if (is (T == interface ) || is (T == class ))
1013
+ static if (is (T == interface ) ||
1014
+ is (T == class ) ||
1015
+ is (T == U2 * , U2 ))
1014
1016
{
1015
1017
GC .free(cast (void * ) x);
1016
1018
x = null ;
1017
1019
}
1018
- else static if (is (T == U2 * , U2 ) || is (T : E2 [], E2 ))
1020
+ else static if (is (T : E2 [], E2 ))
1019
1021
{
1020
- GC .free(&x );
1022
+ GC .free(x.ptr );
1021
1023
x = null ;
1022
1024
}
1023
1025
}
@@ -1151,4 +1153,17 @@ unittest
1151
1153
{
1152
1154
Object x = null ;
1153
1155
__delete(x);
1156
+
1157
+ struct S { ~this () { } }
1158
+ class C { }
1159
+ interface I { }
1160
+
1161
+ int [] a; __delete(a);
1162
+ S[] as; __delete(as);
1163
+ C c; __delete(c);
1164
+ I i; __delete(i);
1165
+ C* pc = &c; __delete(* pc);
1166
+ I* pi = &i; __delete(* pi);
1167
+ int * pint; __delete(pint);
1168
+ S* ps; __delete(ps);
1154
1169
}
Original file line number Diff line number Diff line change @@ -156,6 +156,32 @@ else version(NetBSD)
156
156
int shmdt (in void * );
157
157
int shmget (key_t , size_t , int );
158
158
}
159
+ else version (DragonFlyBSD )
160
+ {
161
+ enum SHM_RDONLY = 0x01000 ; // 010000
162
+ enum SHM_RND = 0x02000 ; // 020000
163
+ enum SHMLBA = 1 << 12 ; // PAGE_SIZE = (1<<PAGE_SHIFT)
164
+
165
+ alias c_ulong shmatt_t;
166
+
167
+ struct shmid_ds
168
+ {
169
+ ipc_perm shm_perm;
170
+ int shm_segsz;
171
+ pid_t shm_lpid;
172
+ pid_t shm_cpid;
173
+ short shm_nattch;
174
+ time_t shm_atime;
175
+ time_t shm_dtime;
176
+ time_t shm_ctime;
177
+ private void * shm_internal;
178
+ }
179
+
180
+ void * shmat (int , in void * , int );
181
+ int shmctl (int , int , shmid_ds* );
182
+ int shmdt (in void * );
183
+ int shmget (key_t , size_t , int );
184
+ }
159
185
else version ( Darwin )
160
186
{
161
187
You can’t perform that action at this time.
0 commit comments