diff -uNr dmd-1.023/dmd/html/d/arrays.html dmd-1.024/dmd/html/d/arrays.html --- dmd-1.023/dmd/html/d/arrays.html 2007-10-05 00:38:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/arrays.html 2007-11-27 21:19:30.000000000 +0100 @@ -34,7 +34,7 @@ -
Last update Fri Oct 5 00:38:20 2007 +
Last update Tue Nov 27 21:19:29 2007
@@ -125,16 +125,15 @@

Arrays

- There are four kinds of arrays: -

+

There are four kinds of arrays:

-
int* p; Pointers to data + - - -
int* p; Pointers to data
int[3] s; Static arrays +
int[3] s; Static arrays
int[] a; Dynamic arrays +
int[] a; Dynamic arrays
int[char[]] x; Associative arrays +
int[char[]] x; Associative arrays

Pointers

@@ -433,35 +432,38 @@

Rectangular Arrays

- Experienced FORTRAN numerics programmers know that multidimensional +

Experienced FORTRAN numerics programmers know that multidimensional "rectangular" arrays for things like matrix operations are much faster than trying to access them via pointers to pointers resulting from "array of pointers to array" semantics. For example, the D syntax: +

double[][] matrix;
 
- declares matrix as an array of pointers to arrays. (Dynamic arrays are implemented as +

declares matrix as an array of pointers to arrays. (Dynamic arrays are implemented as pointers to the array data.) Since the arrays can have varying sizes (being dynamically sized), this is sometimes called "jagged" arrays. Even worse for optimizing the code, the array rows can sometimes point to each other! Fortunately, D static arrays, while using the same syntax, are implemented as a fixed rectangular layout: +

double[3][3] matrix;
 
- declares a rectangular matrix with 3 rows and 3 columns, all contiguously in memory. In +

declares a rectangular matrix with 3 rows and 3 columns, all contiguously in memory. In other languages, this would be called a multidimensional array and be declared as: - +

double matrix[3,3];
 

Array Length

- Within the [ ] of a static or a dynamic array, +

Within the [ ] of a static or a dynamic array, the variable length is implicitly declared and set to the length of the array. The symbol $ can also be so used. +

int[4] foo;
 int[]  bar = foo;
@@ -482,7 +484,8 @@
 
 

Array Properties

- Static array properties are: +

Static array properties are:

+
.sizeof Returns the array length multiplied by the number of bytes per array element. @@ -606,28 +609,30 @@

Setting Dynamic Array Length

- The .length property of a dynamic array can be set +

The .length property of a dynamic array can be set as the lvalue of an = operator: +

array.length = 7;
 
- This causes the array to be reallocated in place, and the existing +

This causes the array to be reallocated in place, and the existing contents copied over to the new array. If the new array length is shorter, only enough are copied to fill the new array. If the new array length is longer, the remainder is filled out with the default initializer. -

+

- To maximize efficiency, the runtime always tries to resize the +

To maximize efficiency, the runtime always tries to resize the array in place to avoid extra copying. It will always do a copy if the new size is larger and the array was not allocated via the new operator or a previous resize operation. -

+

- This means that if there is an array slice immediately following the +

This means that if there is an array slice immediately following the array being resized, the resized array could overlap the slice; i.e.: +

char[] a = new char[20];
 char[] b = a[0..10];
@@ -649,16 +654,17 @@
 		// the old a[3]
 
- To guarantee copying behavior, use the .dup property to ensure +

To guarantee copying behavior, use the .dup property to ensure a unique array that can be resized. -

+

- These issues also apply to concatenating arrays with the ~ and ~= +

These issues also apply to concatenating arrays with the ~ and ~= operators. -

+

- Resizing a dynamic array is a relatively expensive operation. +

Resizing a dynamic array is a relatively expensive operation. So, while the following method of filling an array: +

int[] array;
 while (1)
@@ -670,8 +676,9 @@
 }
 
- will work, it will be inefficient. A more practical +

will work, it will be inefficient. A more practical approach would be to minimize the number of resizes: +

int[] array;
 array.length = 100;        // guess
@@ -686,10 +693,11 @@
 array.length = i;
 
- Picking a good initial guess is an art, but you usually can +

Picking a good initial guess is an art, but you usually can pick a value covering 99% of the cases. For example, when gathering user input from the console - it's unlikely to be longer than 80. +

Functions as Array Properties

@@ -706,12 +714,13 @@

Array Bounds Checking

- It is an error to index an array with an index that is less than +

It is an error to index an array with an index that is less than 0 or greater than or equal to the array length. If an index is out of bounds, an ArrayBoundsError exception is raised if detected at runtime, and an error if detected at compile time. A program may not rely on array bounds checking happening, for example, the following program is incorrect: +

try
 {
@@ -734,37 +743,40 @@
 }
 
- Implementation Note: Compilers should attempt to detect +

Implementation Note: Compilers should attempt to detect array bounds errors at compile time, for example: +

int[3] foo;
 int x = foo[3];		// error, out of bounds
 
- Insertion of array bounds checking code at runtime should be +

Insertion of array bounds checking code at runtime should be turned on and off with a compile time switch. +

Array Initialization

Default Initialization

    -
  • Pointers are initialized to null. -
  • Static array contents are initialized to the default - initializer for the array element type. -
  • Dynamic arrays are initialized to having 0 elements. -
  • Associative arrays are initialized to having 0 elements. +
  • Pointers are initialized to null.
  • +
  • Static array contents are initialized to the default + initializer for the array element type.
  • +
  • Dynamic arrays are initialized to having 0 elements.
  • +
  • Associative arrays are initialized to having 0 elements.

Void Initialization

- Void initialization happens when the Initializer for +

Void initialization happens when the Initializer for an array is void. What it means is that no initialization is done, i.e. the contents of the array will be undefined. This is most useful as an efficiency optimization. Void initializations are an advanced technique and should only be used when profiling indicates that it matters. +

Static Initialization of Static Arrays

@@ -805,12 +817,12 @@ str[0] = 'b'; // error, "abc" is read only, may crash - char[] strings are in UTF-8 format. +

char[] strings are in UTF-8 format. wchar[] strings are in UTF-16 format. dchar[] strings are in UTF-32 format. -

+

- Strings can be copied, compared, concatenated, and appended: +

Strings can be copied, compared, concatenated, and appended:

str1 = str2;
 if (str1 < str3) ...
@@ -818,21 +830,23 @@
 str4 ~= str1;
 
- with the obvious semantics. Any generated temporaries get cleaned up +

with the obvious semantics. Any generated temporaries get cleaned up by the garbage collector (or by using alloca()). Not only that, this works with any array not just a special String array. -

+

- A pointer to a char can be generated: +

A pointer to a char can be generated: +

char* p = &str[3];	// pointer to 4th element
 char* p = str;		// pointer to 1st element
 
- Since strings, however, are not 0 terminated in D, +

Since strings, however, are not 0 terminated in D, when transferring a pointer to a string to C, add a terminating 0: +

str ~= "\0";
 
@@ -964,14 +978,16 @@ func(b["hello"]); // pass 3 as parameter to func() - Particular keys in an associative array can be removed with the +

Particular keys in an associative array can be removed with the remove function: +

b.remove("hello");
 
- The InExpression yields a pointer to the value +

The InExpression yields a pointer to the value if the key is in the associative array, or null if not: +

int* p;
 p = ("hello" in b);
@@ -979,19 +995,20 @@
 	...
 
- KeyTypes cannot be functions or voids. -

+

KeyTypes cannot be functions or voids. +

- If the KeyType is a struct type, a default mechanism is used +

If the KeyType is a struct type, a default mechanism is used to compute the hash and comparisons of it based on the binary data within the struct value. A custom mechanism can be used by providing the following functions as struct members: +

uint toHash();
 int opCmp(KeyType* s);
 
- For example: +

For example:

import std.string;
 
@@ -1104,33 +1121,38 @@
 Properties for associative arrays are:
 
     
-	
-	
+	
 
-	
-	
+	
 
-	
-	
+	
 
-	
-	
+	
 
-	
-	
+	
.sizeof +
.sizeof Returns the size of the reference to the associative array; it is typically 8. +
.length +
.length Returns number of values in the associative array. Unlike for dynamic arrays, it is read-only. +
.keys +
.keys Returns dynamic array, the elements of which are the keys in the associative array. +
.values +
.values Returns dynamic array, the elements of which are the values in the associative array. +
.rehash +
.rehash Reorganizes the associative array in place so that lookups are more efficient. rehash is effective when, for example, the program is done loading up a symbol table and now needs fast lookups in it. Returns a reference to the reorganized array. +
diff -uNr dmd-1.023/dmd/html/d/changelog.html dmd-1.024/dmd/html/d/changelog.html --- dmd-1.023/dmd/html/d/changelog.html 2007-11-01 11:21:22.000000000 +0100 +++ dmd-1.024/dmd/html/d/changelog.html 2007-11-27 21:19:32.000000000 +0100 @@ -34,17 +34,191 @@ -
Last update Thu Nov 1 11:21:21 2007 +
Last update Tue Nov 27 21:19:30 2007
-$(D_S D Change Log, + +
+

D Change Log

+
    +
  • What's new for D 1.024
  • +
  • What's new for D 1.023
  • What's new for D 1.022
  • @@ -104,6 +278,34 @@
    +

    + What's New for + D 1.024 +

    + + +Nov 27, 2007 + +

    New/Changed Features

    + +
    • Changed the way coverage analysis is done so it is independent + of order dependencies among modules.
    • +
    + +

    Bugs Fixed

    + +
    • Bugzilla 70: valgrind: Conditional jump or move depends on uninitialised value(s) in elf_findstr
    • +
    • Bugzilla 71: valgrind: Invalid read of size 4 in elf_renumbersyms
    • +
    • Bugzilla 204: Error message on attempting to instantiate an abstract class needs to be improved
    • +
    • Bugzilla 1508: dmd/linux template symbol issues
    • +
    • Bugzilla 1656: illegal declaration accepted
    • +
    • Bugzilla 1664: (1.23).stringof generates bad code
    • +
    • Bugzilla 1665: Internal error: ..\ztc\cod2.c 411
    • +
    + + +
    +

    What's New for D 1.023 @@ -134,9 +336,12 @@
  • Bugzilla 726: incorrect error line for "override" mixin
  • Bugzilla 729: scope(...) statement in SwitchBody causes compiler to segfault
  • Bugzilla 733: std.conv.toFloat does not catch errors
  • +
  • Bugzilla 1258: Garbage collector loses memory upon array concatenation
  • Bugzilla 1478: Avoid libc network api threadsafety issues
  • +
  • Bugzilla 1480: std.stream throws the new override warning all over the place
  • Bugzilla 1483: Errors in threads not directed to stderr
  • Bugzilla 1491: Suppress SIGPIPE when sending to a dead socket
  • +
  • Bugzilla 1557: std.zlib allocates void[]s instead of ubyte[]s, causing leaks.
  • Bugzilla 1562: Deduction of template alias parameter fails
  • Bugzilla 1575: Cannot do assignment of tuples
  • Bugzilla 1593: ICE compiler crash empty return statement in function
  • @@ -182,6 +387,7 @@
  • Bugzilla 1531: cannot access typedef'd class field
  • Bugzilla 1537: Internal error: ..\ztc\cgcod.c 1521
  • Bugzilla 1609: TypeInfo_Typedef has incorrect implementation of next()
  • +


@@ -872,7 +1078,24 @@
  • Bugzilla 826: ICE: is-expression with invalid template instantiation
  • - + + +

    +

    + + + + +
    + diff -uNr dmd-1.023/dmd/html/d/cppstrings.html dmd-1.024/dmd/html/d/cppstrings.html --- dmd-1.023/dmd/html/d/cppstrings.html 2007-10-05 00:38:20.000000000 +0200 +++ dmd-1.024/dmd/html/d/cppstrings.html 2007-11-27 21:19:30.000000000 +0100 @@ -35,7 +35,7 @@ -
    Last update Fri Oct 5 00:38:18 2007 +
    Last update Tue Nov 27 21:19:29 2007
    @@ -385,7 +385,7 @@ int inword; int wstart; - input = cast(char[])file.read(args[i]); + input = cast(char[])std.file.read(args[i]); for (int j = 0; j < input.length; j++) { char c; diff -uNr dmd-1.023/dmd/html/d/dcompiler.html dmd-1.024/dmd/html/d/dcompiler.html --- dmd-1.023/dmd/html/d/dcompiler.html 2007-10-05 00:38:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/dcompiler.html 2007-11-27 21:19:32.000000000 +0100 @@ -25,8 +25,7 @@
    -
    -
    Last update Fri Oct 5 00:38:21 2007 +
    Last update Tue Nov 27 21:19:30 2007
    @@ -223,22 +222,51 @@

    Downloads

    -

    Files Common to Win32 and Linux

    @@ -259,17 +287,14 @@
    -

    Win32 D Compiler

    +

    DMD Win32 D Compiler

    Requirements and Downloads

      -
    • 32 bit Windows (Win32) operating system, such as Windows XP +
    • 32 bit Windows (Win32) operating system, such as Windows XP
    • -
    • Download - - dmd.zip (D compiler) for Win32 -
    • +
    • Download dmd
    • Download @@ -399,11 +424,15 @@ not compiling for symbolic debugging instead of phobos.lib
      -g -
      add CodeView 4 symbolic debug info
      +
      add CodeView 4 symbolic debug info with + D extensions + for debuggers such as + Ddbg
      -gc
      add CodeView 4 symbolic debug info in C format - (for C debuggers)
      + for debuggers such as + \dmd\bin\windbg
      -H
      @@ -591,17 +620,7 @@
      • 32 bit x86 Linux operating system
      • -
      • Download - - dmd.zip (D compiler) for Linux - - - -
      • +
      • Download dmd
      • Gnu C compiler (gcc)
      • @@ -724,11 +743,19 @@
        -fPIC
        generate position independent code -
        -g
        -
        add symbolic debug info + +
        -g +
        add Dwarf symbolic debug info with + D extensions + for debuggers such as + ZeroBUGS
        +
        -gc -
        add symbolic debug info in C format (for older gdb's)
        +
        add Dwarf symbolic debug info in C format + for debuggers such as + gdb
        +
        -H
        generate D interface file
        @@ -932,8 +959,7 @@ Copyright © 1999-2007 by Digital Mars, All Rights Reserved | Page generated by Ddoc. | -Comments +Comments diff -uNr dmd-1.023/dmd/html/d/declaration.html dmd-1.024/dmd/html/d/declaration.html --- dmd-1.023/dmd/html/d/declaration.html 2007-10-05 00:38:20.000000000 +0200 +++ dmd-1.024/dmd/html/d/declaration.html 2007-11-27 21:19:30.000000000 +0100 @@ -33,7 +33,7 @@
      -
      Last update Fri Oct 5 00:38:19 2007 +
      Last update Tue Nov 27 21:19:29 2007
      @@ -210,9 +210,6 @@ TemplateInstance TemplateInstance . IdentifierList -Typeof: - typeof ( Expression ) - StorageClasses: StorageClass StorageClass StorageClasses @@ -262,7 +259,7 @@ lazy Initializer: - void + VoidInitializer NonVoidInitializer NonVoidInitializer: @@ -548,6 +545,11 @@

      typeof

      +
      Typeof:
      +        typeof ( Expression )
      +        typeof ( return )
      +
      +

      Typeof is a way to specify a type based on the type of an expression. For example: @@ -578,12 +580,16 @@

    - There are two special cases: - typeof(this) will generate the type of what this + There are two special cases: +

    1. typeof(this) will generate the type of what this would be in a non-static member function, even if not in a member function. - Analogously, typeof(super) will generate the type of what +
    2. +
    3. Analogously, typeof(super) will generate the type of what super would be in a non-static member function. +
    4. + +

    class A { }
    @@ -610,6 +616,10 @@
     
     

    Void Initializations

    +
    VoidInitializer:
    +	void
    +
    + Normally, variables are initialized either with an explicit Initializer or are set to the default value for the type of the variable. If the Initializer is void, diff -uNr dmd-1.023/dmd/html/d/expression.html dmd-1.024/dmd/html/d/expression.html --- dmd-1.023/dmd/html/d/expression.html 2007-10-05 00:38:20.000000000 +0200 +++ dmd-1.024/dmd/html/d/expression.html 2007-11-27 21:19:30.000000000 +0100 @@ -33,7 +33,7 @@ -
    Last update Fri Oct 5 00:38:19 2007 +
    Last update Tue Nov 27 21:19:29 2007
    @@ -1459,6 +1459,7 @@ enum function delegate + then the condition is satisifed if Type is one of those.
    alias short bar;
    @@ -1552,13 +1553,14 @@
     		enum
     		function
     		delegate
    +
     	then the condition is satisifed if Type is one of those.
     	Furthermore, Identifier is set to be an alias of the type:
     	

    - + diff -uNr dmd-1.023/dmd/html/d/garbage.html dmd-1.024/dmd/html/d/garbage.html --- dmd-1.023/dmd/html/d/garbage.html 2007-10-05 00:38:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/garbage.html 2007-11-27 21:19:32.000000000 +0100 @@ -34,7 +34,7 @@ -
    Last update Fri Oct 5 00:38:20 2007 +
    Last update Tue Nov 27 21:19:30 2007
    @@ -125,114 +125,135 @@

    Garbage Collection

    - D is a fully garbage collected language. That means that it is never necessary +

    D is a fully garbage collected language. That means that it is never + necessary to free memory. Just allocate as needed, and the garbage collector will periodically return all unused memory to the pool of available memory. -

    +

    - C and C++ programmers accustomed to explicitly managing memory +

    C and C++ programmers accustomed to explicitly managing memory allocation and deallocation will likely be skeptical of the benefits and efficacy of garbage collection. Experience both with new projects written with garbage collection in mind, and converting existing projects to garbage collection shows that: +

      -
    • Garbage collected programs are faster. This is counterintuitive, +
    • Garbage collected programs are faster. This is counterintuitive, but the reasons are:
        -
      • Reference counting is a common solution to solve explicit +
      • Reference counting is a common solution to solve explicit memory allocation problems. The code to implement the increment and decrement operations whenever assignments are made is one source of slowdown. Hiding it behind smart pointer classes doesn't help the speed. (Reference counting methods are not a general solution anyway, as circular references never get deleted.) +
      • -
      • Destructors are used to deallocate resources acquired by an object. +
      • Destructors are used to deallocate resources acquired by an object. For most classes, this resource is allocated memory. With garbage collection, most destructors then become empty and can be discarded entirely. +
      • -
      • All those destructors freeing memory can become significant when +
      • All those destructors freeing memory can become significant when objects are allocated on the stack. For each one, some mechanism must be established so that if an exception happens, the destructors all get called in each frame to release any memory they hold. If the destructors become irrelevant, then there's no need to set up special stack frames to handle exceptions, and the code runs faster. +
      • -
      • All the code necessary to manage memory can add up to quite a +
      • All the code necessary to manage memory can add up to quite a bit. The larger a program is, the less in the cache it is, the more paging it does, and the slower it runs. +
      • -
      • Garbage collection kicks in only when memory gets tight. When +
      • Garbage collection kicks in only when memory gets tight. When memory is not tight, the program runs at full speed and does not spend any time freeing memory. +
      • -
      • Modern garbage collectors are far more advanced now than the +
      • Modern garbage collectors are far more advanced now than the older, slower ones. Generational, copying collectors eliminate much of the inefficiency of early mark and sweep algorithms. +
      • -
      • Modern garbage collectors do heap compaction. Heap compaction +
      • Modern garbage collectors do heap compaction. Heap compaction tends to reduce the number of pages actively referenced by a program, which means that memory accesses are more likely to be cache hits and less swapping. +
      • -
      • Garbage collected programs do not suffer from gradual deterioration +
      • Garbage collected programs do not suffer from gradual deterioration due to an accumulation of memory leaks. +
      +
    • - -
    • Garbage collectors reclaim unused memory, therefore they do not suffer +
    • Garbage collectors reclaim unused memory, therefore they do not suffer from "memory leaks" which can cause long running applications to gradually consume more and more memory until they bring down the system. GC programs have longer term stability. +
    • -
    • Garbage collected programs have fewer hard-to-find pointer bugs. This +
    • Garbage collected programs have fewer hard-to-find pointer bugs. This is because there are no dangling references to freed memory. There is no code to explicitly manage memory, hence no bugs in such code. +
    • -
    • Garbage collected programs are faster to develop and debug, because +
    • Garbage collected programs are faster to develop and debug, because there's no need for developing, debugging, testing, or maintaining the explicit deallocation code. +
    • -
    • Garbage collected programs can be significantly smaller, because +
    • Garbage collected programs can be significantly smaller, because there is no code to manage deallocation, and there is no need for exception handlers to deallocate memory. - +
    - Garbage collection is not a panacea. There are some downsides: +

    Garbage collection is not a panacea. There are some downsides: +

      -
    • It is not predictable when a collection gets run, so the program +
    • It is not predictable when a collection gets run, so the program can arbitrarily pause. +
    • -
    • The time it takes for a collection to run is not bounded. While in +
    • The time it takes for a collection to run is not bounded. While in practice it is very quick, this cannot be guaranteed. +
    • -
    • All threads other than the collector thread must be halted while +
    • All threads other than the collector thread must be halted while the collection is in progress. +
    • -
    • Garbage collectors can keep around some memory that an explicit deallocator +
    • Garbage collectors can keep around some memory that an explicit + deallocator would not. In practice, this is not much of an issue since explicit deallocators usually have memory leaks causing them to eventually use far more memory, and because explicit deallocators do not normally return deallocated memory to the operating system anyway, instead just returning it to its own internal pool. +
    • -
    • Garbage collection should be implemented as a basic operating system +
    • Garbage collection should be implemented as a basic operating + system kernel service. But since they are not, garbage collecting programs must carry around with them the garbage collection implementation. While this can be a shared DLL, it is still there. - +
    - These constraints are addressed by techniques outlined +

    These constraints are addressed by techniques outlined in Memory Management. +

    How Garbage Collection Works

    @@ -278,30 +299,31 @@

    Pointers and the Garbage Collector

    - Pointers in D can be broadly divided into two categories: those that +

    Pointers in D can be broadly divided into two categories: those that point to garbage collected memory, and those that do not. Examples of the latter are pointers created by calls to C's malloc(), pointers received from C library routines, pointers to static data, pointers to objects on the stack, etc. For those pointers, anything that is legal in C can be done with them. -

    +

    - For garbage collected pointers and references, however, there are some +

    For garbage collected pointers and references, however, there are + some restrictions. These restrictions are minor, but they are intended to enable the maximum flexibility in garbage collector design. -

    +

    - Undefined behavior: +

    Undefined behavior:

      -
    • Do not xor pointers with other values, like the +
    • Do not xor pointers with other values, like the xor pointer linked list trick used in C. -

      +

    • -
    • Do not use the xor trick to swap two pointer values. -

      +

    • Do not use the xor trick to swap two pointer values. +
    • -
    • Do not store pointers into non-pointer variables using casts and +
    • Do not store pointers into non-pointer variables using casts and other tricks.
      void* p;
      @@ -310,46 +332,47 @@
       
      The garbage collector does not scan non-pointer types for roots. -

      +

    • -
    • Do not take advantage of alignment of pointers to store bit flags +
    • Do not take advantage of alignment of pointers to store bit flags in the low order bits:
      p = cast(void*)(cast(int)p | 1);  // error: undefined behavior
       
      +
    • -
    • Do not store into pointers values that may point into the +
    • Do not store into pointers values that may point into the garbage collected heap:
      p = cast(void*)12345678;   // error: undefined behavior
       
      A copying garbage collector may change this value. -

      +

    • -
    • Do not store magic values into pointers, other than null. -

      +

    • Do not store magic values into pointers, other than null. +
    • -
    • Do not write pointer values out to disk and read them back in +
    • Do not write pointer values out to disk and read them back in again. -

      +

    • -
    • Do not use pointer values to compute a hash function. A copying +
    • Do not use pointer values to compute a hash function. A copying garbage collector can arbitrarily move objects around in memory, thus invalidating the computed hash value. -

      +

    • -
    • Do not depend on the ordering of pointers: +
    • Do not depend on the ordering of pointers:
      if (p1 < p2)		// error: undefined behavior
           ...
       
      since, again, the garbage collector can move objects around in memory. -

      +

    • -
    • Do not add or subtract an offset to a pointer such that the result +
    • Do not add or subtract an offset to a pointer such that the result points outside of the bounds of the garbage collected object originally allocated. @@ -358,8 +381,9 @@ q = p + 11; // error: undefined behavior q = p - 1; // error: undefined behavior +
    • -
    • Do not misalign pointers if those pointers may +
    • Do not misalign pointers if those pointers may point into the gc heap, such as:
      align (1) struct Foo
      @@ -371,9 +395,9 @@
       	Misaligned pointers may be used if the underlying hardware
       	supports them and the pointer is never used to point
       	into the gc heap.
      -	

      +

    • -
    • Do not use byte-by-byte memory copies to copy pointer values. +
    • Do not use byte-by-byte memory copies to copy pointer values. This may result in intermediate conditions where there is not a valid pointer, and if the gc pauses the thread in such a condition, it can corrupt memory. @@ -382,7 +406,7 @@ greater than or equal to a pointer size, but since this kind of implementation is not guaranteed by the C standard, use memcpy() only with extreme caution. - +

    Things that are reliable and can be done:

    @@ -405,26 +429,30 @@ - One can avoid using pointers anyway for most tasks. D provides features +

    One can avoid using pointers anyway for most tasks. D provides + features rendering most explicit pointer uses obsolete, such as reference objects, dynamic arrays, and garbage collection. Pointers are provided in order to interface successfully with C APIs and for some low level work. +

    Working with the Garbage Collector

    - Garbage collection doesn't solve every memory deallocation problem. For +

    Garbage collection doesn't solve every memory deallocation problem. + For example, if a root to a large data structure is kept, the garbage collector cannot reclaim it, even if it is never referred to again. To eliminate this problem, it is good practice to set a reference or pointer to an object to null when no longer needed. -

    +

    - This advice applies only to static references or references embedded +

    This advice applies only to static references or references embedded inside other objects. There is not much point for such stored on the stack to be nulled, since the collector doesn't scan for roots past the top of the stack, and because new stack frames are initialized anyway. +

    References

    diff -uNr dmd-1.023/dmd/html/d/interface.html dmd-1.024/dmd/html/d/interface.html --- dmd-1.023/dmd/html/d/interface.html 2007-10-05 00:38:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/interface.html 2007-11-27 21:19:32.000000000 +0100 @@ -34,7 +34,7 @@
    -
    Last update Fri Oct 5 00:38:20 2007 +
    Last update Tue Nov 27 21:19:30 2007
    @@ -269,17 +269,20 @@ } // error, no foo() for interface D + +

    COM Interfaces

    - A variant on interfaces is the COM interface. A COM interface is +

    A variant on interfaces is the COM interface. A COM interface is designed to map directly onto a Windows COM object. Any COM object can be represented by a COM interface, and any D object with a COM interface can be used by external COM clients. -

    +

    - A COM interface is defined as one that derives from the interface +

    A COM interface is defined as one that derives from the interface std.c.windows.com.IUnknown. A COM interface differs from a regular D interface in that: +

    • It derives from the interface std.c.windows.com.IUnknown.
    • It cannot be the argument of a DeleteExpression.
    • @@ -290,6 +293,7 @@
    +



    diff -uNr dmd-1.023/dmd/html/d/phobos/object.html dmd-1.024/dmd/html/d/phobos/object.html --- dmd-1.023/dmd/html/d/phobos/object.html 2007-11-01 03:02:34.000000000 +0100 +++ dmd-1.024/dmd/html/d/phobos/object.html 2007-11-27 21:06:42.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Thu Nov 1 03:02:33 2007 +
    Last update Tue Nov 27 21:06:41 2007
    @@ -263,7 +263,7 @@

    -
    Interface [] interfaces; +
    Interface[] interfaces;
    interfaces this class implements

    @@ -301,7 +301,7 @@

    -
    uint offset; +
    size_t offset;
    Offset of member from start of object

    diff -uNr dmd-1.023/dmd/html/d/phobos/phobos.html dmd-1.024/dmd/html/d/phobos/phobos.html --- dmd-1.023/dmd/html/d/phobos/phobos.html 2007-10-05 00:37:24.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/phobos.html 2007-11-27 21:06:46.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:22 2007 +
    Last update Tue Nov 27 21:06:44 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_base64.html dmd-1.024/dmd/html/d/phobos/std_base64.html --- dmd-1.023/dmd/html/d/phobos/std_base64.html 2007-10-05 00:37:20.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_base64.html 2007-11-27 21:06:42.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:19 2007 +
    Last update Tue Nov 27 21:06:41 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_bind.html dmd-1.024/dmd/html/d/phobos/std_bind.html --- dmd-1.023/dmd/html/d/phobos/std_bind.html 2007-10-05 00:37:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_bind.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:20 2007 +
    Last update Tue Nov 27 21:06:42 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_bitarray.html dmd-1.024/dmd/html/d/phobos/std_bitarray.html --- dmd-1.023/dmd/html/d/phobos/std_bitarray.html 2007-10-05 00:37:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_bitarray.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:20 2007 +
    Last update Tue Nov 27 21:06:42 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_boxer.html dmd-1.024/dmd/html/d/phobos/std_boxer.html --- dmd-1.023/dmd/html/d/phobos/std_boxer.html 2007-10-05 00:37:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_boxer.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:20 2007 +
    Last update Tue Nov 27 21:06:42 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_c_fenv.html dmd-1.024/dmd/html/d/phobos/std_c_fenv.html --- dmd-1.023/dmd/html/d/phobos/std_c_fenv.html 2007-10-05 00:37:24.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_c_fenv.html 2007-11-27 21:06:46.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:22 2007 +
    Last update Tue Nov 27 21:06:44 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_c_locale.html dmd-1.024/dmd/html/d/phobos/std_c_locale.html --- dmd-1.023/dmd/html/d/phobos/std_c_locale.html 2007-10-05 00:37:24.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_c_locale.html 2007-11-27 21:06:46.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:22 2007 +
    Last update Tue Nov 27 21:06:44 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_c_math.html dmd-1.024/dmd/html/d/phobos/std_c_math.html --- dmd-1.023/dmd/html/d/phobos/std_c_math.html 2007-10-05 00:37:24.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_c_math.html 2007-11-27 21:06:46.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:22 2007 +
    Last update Tue Nov 27 21:06:44 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_compiler.html dmd-1.024/dmd/html/d/phobos/std_compiler.html --- dmd-1.023/dmd/html/d/phobos/std_compiler.html 2007-10-05 00:37:20.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_compiler.html 2007-11-27 21:06:42.000000000 +0100 @@ -33,7 +33,7 @@ -
    Last update Fri Oct 5 00:37:19 2007 +
    Last update Tue Nov 27 21:06:41 2007
    @@ -139,7 +139,7 @@

    -
    const char[] name; +
    const string name;
    Vendor specific string naming the compiler, for example: "Digital Mars D".

    diff -uNr dmd-1.023/dmd/html/d/phobos/std_conv.html dmd-1.024/dmd/html/d/phobos/std_conv.html --- dmd-1.023/dmd/html/d/phobos/std_conv.html 2007-11-01 03:02:34.000000000 +0100 +++ dmd-1.024/dmd/html/d/phobos/std_conv.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Thu Nov 1 03:02:33 2007 +
    Last update Tue Nov 27 21:06:42 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_cover.html dmd-1.024/dmd/html/d/phobos/std_cover.html --- dmd-1.023/dmd/html/d/phobos/std_cover.html 2007-10-05 00:37:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_cover.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:20 2007 +
    Last update Tue Nov 27 21:06:42 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_c_process.html dmd-1.024/dmd/html/d/phobos/std_c_process.html --- dmd-1.023/dmd/html/d/phobos/std_c_process.html 2007-10-05 00:37:24.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_c_process.html 2007-11-27 21:06:46.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:22 2007 +
    Last update Tue Nov 27 21:06:44 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_cpuid.html dmd-1.024/dmd/html/d/phobos/std_cpuid.html --- dmd-1.023/dmd/html/d/phobos/std_cpuid.html 2007-10-05 00:37:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_cpuid.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:20 2007 +
    Last update Tue Nov 27 21:06:42 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_c_stdarg.html dmd-1.024/dmd/html/d/phobos/std_c_stdarg.html --- dmd-1.023/dmd/html/d/phobos/std_c_stdarg.html 2007-10-05 00:37:24.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_c_stdarg.html 2007-11-27 21:06:46.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:22 2007 +
    Last update Tue Nov 27 21:06:44 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_c_stddef.html dmd-1.024/dmd/html/d/phobos/std_c_stddef.html --- dmd-1.023/dmd/html/d/phobos/std_c_stddef.html 2007-10-05 00:37:24.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_c_stddef.html 2007-11-27 21:06:46.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:22 2007 +
    Last update Tue Nov 27 21:06:44 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_c_stdio.html dmd-1.024/dmd/html/d/phobos/std_c_stdio.html --- dmd-1.023/dmd/html/d/phobos/std_c_stdio.html 2007-10-05 00:37:24.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_c_stdio.html 2007-11-27 21:06:46.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:22 2007 +
    Last update Tue Nov 27 21:06:44 2007
    @@ -183,7 +183,7 @@


    -
    _iobuf [60u] _iob; +
    FILE[_NFILE] _iob;


    @@ -191,7 +191,7 @@


    -
    ubyte[60u] __fhnd_info; +
    ubyte[_NFILE] __fhnd_info;


    diff -uNr dmd-1.023/dmd/html/d/phobos/std_c_stdlib.html dmd-1.024/dmd/html/d/phobos/std_c_stdlib.html --- dmd-1.023/dmd/html/d/phobos/std_c_stdlib.html 2007-10-05 00:37:24.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_c_stdlib.html 2007-11-27 21:06:46.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:22 2007 +
    Last update Tue Nov 27 21:06:44 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_cstream.html dmd-1.024/dmd/html/d/phobos/std_cstream.html --- dmd-1.023/dmd/html/d/phobos/std_cstream.html 2007-10-05 00:37:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_cstream.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:20 2007 +
    Last update Tue Nov 27 21:06:42 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_c_string.html dmd-1.024/dmd/html/d/phobos/std_c_string.html --- dmd-1.023/dmd/html/d/phobos/std_c_string.html 2007-10-05 00:37:24.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_c_string.html 2007-11-27 21:06:46.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:22 2007 +
    Last update Tue Nov 27 21:06:44 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_c_time.html dmd-1.024/dmd/html/d/phobos/std_c_time.html --- dmd-1.023/dmd/html/d/phobos/std_c_time.html 2007-10-05 00:37:24.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_c_time.html 2007-11-27 21:06:46.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:22 2007 +
    Last update Tue Nov 27 21:06:44 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_ctype.html dmd-1.024/dmd/html/d/phobos/std_ctype.html --- dmd-1.023/dmd/html/d/phobos/std_ctype.html 2007-10-05 00:37:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_ctype.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:20 2007 +
    Last update Tue Nov 27 21:06:42 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_c_wcharh.html dmd-1.024/dmd/html/d/phobos/std_c_wcharh.html --- dmd-1.023/dmd/html/d/phobos/std_c_wcharh.html 2007-10-05 00:37:24.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_c_wcharh.html 2007-11-27 21:06:46.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:22 2007 +
    Last update Tue Nov 27 21:06:44 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_date.html dmd-1.024/dmd/html/d/phobos/std_date.html --- dmd-1.023/dmd/html/d/phobos/std_date.html 2007-10-05 00:37:20.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_date.html 2007-11-27 21:06:42.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:19 2007 +
    Last update Tue Nov 27 21:06:41 2007
    @@ -150,7 +150,7 @@

    -
    const long d_time_nan; +
    const d_time d_time_nan;
    A value for d_time that does not represent a valid time. diff -uNr dmd-1.023/dmd/html/d/phobos/std_demangle.html dmd-1.024/dmd/html/d/phobos/std_demangle.html --- dmd-1.023/dmd/html/d/phobos/std_demangle.html 2007-10-05 00:37:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_demangle.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:20 2007 +
    Last update Tue Nov 27 21:06:42 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_file.html dmd-1.024/dmd/html/d/phobos/std_file.html --- dmd-1.023/dmd/html/d/phobos/std_file.html 2007-10-05 00:37:20.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_file.html 2007-11-27 21:06:42.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:19 2007 +
    Last update Tue Nov 27 21:06:41 2007
    @@ -302,19 +302,19 @@

    -
    long creationTime; +
    d_time creationTime;
    time of file creation

    -
    long lastAccessTime; +
    d_time lastAccessTime;
    time file was last accessed

    -
    long lastWriteTime; +
    d_time lastWriteTime;
    time file was last written to

    diff -uNr dmd-1.023/dmd/html/d/phobos/std_format.html dmd-1.024/dmd/html/d/phobos/std_format.html --- dmd-1.023/dmd/html/d/phobos/std_format.html 2007-10-05 00:37:20.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_format.html 2007-11-27 21:06:42.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:19 2007 +
    Last update Tue Nov 27 21:06:41 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_gc.html dmd-1.024/dmd/html/d/phobos/std_gc.html --- dmd-1.023/dmd/html/d/phobos/std_gc.html 2007-10-05 00:37:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_gc.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:20 2007 +
    Last update Tue Nov 27 21:06:42 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_intrinsic.html dmd-1.024/dmd/html/d/phobos/std_intrinsic.html --- dmd-1.023/dmd/html/d/phobos/std_intrinsic.html 2007-10-05 00:37:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_intrinsic.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:20 2007 +
    Last update Tue Nov 27 21:06:43 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_math.html dmd-1.024/dmd/html/d/phobos/std_math.html --- dmd-1.023/dmd/html/d/phobos/std_math.html 2007-10-05 00:37:20.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_math.html 2007-11-27 21:06:42.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:18 2007 +
    Last update Tue Nov 27 21:06:40 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_md5.html dmd-1.024/dmd/html/d/phobos/std_md5.html --- dmd-1.023/dmd/html/d/phobos/std_md5.html 2007-10-05 00:37:20.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_md5.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:19 2007 +
    Last update Tue Nov 27 21:06:42 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_metastrings.html dmd-1.024/dmd/html/d/phobos/std_metastrings.html --- dmd-1.023/dmd/html/d/phobos/std_metastrings.html 2007-10-05 00:37:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_metastrings.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:20 2007 +
    Last update Tue Nov 27 21:06:43 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_mmfile.html dmd-1.024/dmd/html/d/phobos/std_mmfile.html --- dmd-1.023/dmd/html/d/phobos/std_mmfile.html 2007-10-05 00:37:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_mmfile.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:20 2007 +
    Last update Tue Nov 27 21:06:43 2007
    @@ -175,7 +175,7 @@

    -
    this(char[] filename, Mode mode, ulong size, void* address, uint window = cast(uint)0); +
    this(char[] filename, Mode mode, ulong size, void* address, size_t window = 0);
    Open memory mapped file filename in mode. File is closed when the object instance is deleted. diff -uNr dmd-1.023/dmd/html/d/phobos/std_openrj.html dmd-1.024/dmd/html/d/phobos/std_openrj.html --- dmd-1.023/dmd/html/d/phobos/std_openrj.html 2007-10-05 00:37:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_openrj.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:21 2007 +
    Last update Tue Nov 27 21:06:43 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_outbuffer.html dmd-1.024/dmd/html/d/phobos/std_outbuffer.html --- dmd-1.023/dmd/html/d/phobos/std_outbuffer.html 2007-10-05 00:37:20.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_outbuffer.html 2007-11-27 21:06:42.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:18 2007 +
    Last update Tue Nov 27 21:06:40 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_outofmemory.html dmd-1.024/dmd/html/d/phobos/std_outofmemory.html --- dmd-1.023/dmd/html/d/phobos/std_outofmemory.html 2007-10-05 00:37:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_outofmemory.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:21 2007 +
    Last update Tue Nov 27 21:06:43 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_path.html dmd-1.024/dmd/html/d/phobos/std_path.html --- dmd-1.023/dmd/html/d/phobos/std_path.html 2007-10-05 00:37:18.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_path.html 2007-11-27 21:06:42.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:17 2007 +
    Last update Tue Nov 27 21:06:40 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_process.html dmd-1.024/dmd/html/d/phobos/std_process.html --- dmd-1.023/dmd/html/d/phobos/std_process.html 2007-10-05 00:37:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_process.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:21 2007 +
    Last update Tue Nov 27 21:06:43 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_random.html dmd-1.024/dmd/html/d/phobos/std_random.html --- dmd-1.023/dmd/html/d/phobos/std_random.html 2007-10-05 00:37:20.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_random.html 2007-11-27 21:06:42.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:19 2007 +
    Last update Tue Nov 27 21:06:41 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_regexp.html dmd-1.024/dmd/html/d/phobos/std_regexp.html --- dmd-1.023/dmd/html/d/phobos/std_regexp.html 2007-11-01 03:02:34.000000000 +0100 +++ dmd-1.024/dmd/html/d/phobos/std_regexp.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Thu Nov 1 03:02:33 2007 +
    Last update Tue Nov 27 21:06:43 2007
    @@ -406,7 +406,7 @@

    -
    this(char[] pattern, char[] attributes = null); +
    this(rchar[] pattern, rchar[] attributes = null);
    Construct a RegExp object. Compile pattern with attributes into diff -uNr dmd-1.023/dmd/html/d/phobos/std_signals.html dmd-1.024/dmd/html/d/phobos/std_signals.html --- dmd-1.023/dmd/html/d/phobos/std_signals.html 2007-10-05 00:37:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_signals.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:21 2007 +
    Last update Tue Nov 27 21:06:43 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_socket.html dmd-1.024/dmd/html/d/phobos/std_socket.html --- dmd-1.023/dmd/html/d/phobos/std_socket.html 2007-11-01 03:02:36.000000000 +0100 +++ dmd-1.024/dmd/html/d/phobos/std_socket.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Thu Nov 1 03:02:34 2007 +
    Last update Tue Nov 27 21:06:43 2007
    @@ -274,8 +274,8 @@

    ProtocolType type; -
    char[] name; -
    char[][] aliases; +
    string name; +
    string[] aliases;
    These members are populated when one of the following functions are called without failure:

    @@ -301,10 +301,10 @@

    -
    char[] name; -
    char[][] aliases; +
    string name; +
    string[] aliases;
    ushort port; -
    char[] protocolName; +
    string protocolName;
    These members are populated when one of the following functions are called without failure:

    @@ -345,9 +345,9 @@

    -
    char[] name; -
    char[][] aliases; -
    uint[] addrList; +
    string name; +
    string[] aliases; +
    uint32_t[] addrList;
    These members are populated when one of the following functions are called without failure:

    @@ -454,7 +454,7 @@

    -
    this(char[] addr, ushort port); +
    this(string addr, ushort port);
    Params:
    keyword - alias type for Identifier + keywordalias type for Identifier
    typedef the type that Type is a typedef of
    @@ -685,13 +685,13 @@
    Linger information for use with SocketOption.LINGER.

    -
    ushort on; +
    uint16_t on;
    Nonzero for on.

    -
    ushort time; +
    uint16_t time;
    Linger time.

    @@ -775,7 +775,7 @@
    this(AddressFamily af, SocketType type, ProtocolType protocol);
    this(AddressFamily af, SocketType type); -
    this(AddressFamily af, SocketType type, char[] protocolName); +
    this(AddressFamily af, SocketType type, string protocolName);
    Create a blocking socket. If a single protocol type exists to support this socket type within the address family, the ProtocolType may be diff -uNr dmd-1.023/dmd/html/d/phobos/std_socketstream.html dmd-1.024/dmd/html/d/phobos/std_socketstream.html --- dmd-1.023/dmd/html/d/phobos/std_socketstream.html 2007-10-05 00:37:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_socketstream.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:21 2007 +
    Last update Tue Nov 27 21:06:43 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_stdint.html dmd-1.024/dmd/html/d/phobos/std_stdint.html --- dmd-1.023/dmd/html/d/phobos/std_stdint.html 2007-10-05 00:37:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_stdint.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:21 2007 +
    Last update Tue Nov 27 21:06:43 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_stdio.html dmd-1.024/dmd/html/d/phobos/std_stdio.html --- dmd-1.023/dmd/html/d/phobos/std_stdio.html 2007-10-05 00:37:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_stdio.html 2007-11-27 21:06:46.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:21 2007 +
    Last update Tue Nov 27 21:06:44 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_stream.html dmd-1.024/dmd/html/d/phobos/std_stream.html --- dmd-1.023/dmd/html/d/phobos/std_stream.html 2007-10-05 00:37:20.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_stream.html 2007-11-27 21:06:42.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:18 2007 +
    Last update Tue Nov 27 21:06:41 2007
    @@ -754,7 +754,7 @@

    -
    this(Stream source, uint bufferSize = 8192u); +
    this(Stream source, uint bufferSize = DefaultBufferSize);
    Create a buffered stream for the stream source with the buffer size bufferSize. @@ -795,7 +795,7 @@
    This subclass is for unbuffered file system streams.

    -
    this(char[] filename, FileMode mode = cast(FileMode)1); +
    this(char[] filename, FileMode mode = (FileMode).In);
    Create the stream with no open file, an open file in read mode, or an open file with explicit file mode. @@ -859,13 +859,13 @@

    -
    this(char[] filename, FileMode mode = cast(FileMode)1, uint bufferSize = 8192u); +
    this(char[] filename, FileMode mode = (FileMode).In, uint bufferSize = DefaultBufferSize);
    opens file in requested mode and buffer size

    -
    this(File file, uint bufferSize = 8192u); +
    this(File file, uint bufferSize = DefaultBufferSize);
    opens file for reading with requested buffer size

    @@ -946,7 +946,7 @@

    -
    this(Stream source, Endian end = cast(Endian)1); +
    this(Stream source, Endian end = module system.endian);
    Create the endian stream for the source stream source with endianness end. The default endianness is the native byte order. diff -uNr dmd-1.023/dmd/html/d/phobos/std_string.html dmd-1.024/dmd/html/d/phobos/std_string.html --- dmd-1.023/dmd/html/d/phobos/std_string.html 2007-10-05 00:37:20.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_string.html 2007-11-27 21:06:42.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:19 2007 +
    Last update Tue Nov 27 21:06:41 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_system.html dmd-1.024/dmd/html/d/phobos/std_system.html --- dmd-1.023/dmd/html/d/phobos/std_system.html 2007-11-01 03:02:36.000000000 +0100 +++ dmd-1.024/dmd/html/d/phobos/std_system.html 2007-11-27 21:06:46.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Thu Nov 1 03:02:34 2007 +
    Last update Tue Nov 27 21:06:44 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_thread.html dmd-1.024/dmd/html/d/phobos/std_thread.html --- dmd-1.023/dmd/html/d/phobos/std_thread.html 2007-11-01 03:02:36.000000000 +0100 +++ dmd-1.024/dmd/html/d/phobos/std_thread.html 2007-11-27 21:06:46.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Thu Nov 1 03:02:34 2007 +
    Last update Tue Nov 27 21:06:44 2007
    @@ -158,7 +158,7 @@

    -
    this(uint stacksize = cast(uint)0); +
    this(size_t stacksize = 0);
    Constructor used by classes derived from Thread that override main(). The optional stacksize parameter default value of 0 will cause threads @@ -167,21 +167,21 @@

    -
    this(int(* fp)(void*), void* arg, uint stacksize = cast(uint)0); +
    this(int(* fp)(void*), void* arg, size_t stacksize = 0);
    Constructor used by classes derived from Thread that override run().

    -
    this(int delegate() dg, uint stacksize = cast(uint)0); +
    this(int delegate() dg, size_t stacksize = 0);
    Constructor used by classes derived from Thread that override run().

    -
    HANDLE hdl; +
    thread_hdl hdl;
    The handle to this thread assigned by the operating system. This is set to thread_id.init if the thread hasn't been started yet. diff -uNr dmd-1.023/dmd/html/d/phobos/std_traits.html dmd-1.024/dmd/html/d/phobos/std_traits.html --- dmd-1.023/dmd/html/d/phobos/std_traits.html 2007-10-05 00:37:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_traits.html 2007-11-27 21:06:46.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:22 2007 +
    Last update Tue Nov 27 21:06:44 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_typetuple.html dmd-1.024/dmd/html/d/phobos/std_typetuple.html --- dmd-1.023/dmd/html/d/phobos/std_typetuple.html 2007-10-05 00:37:24.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_typetuple.html 2007-11-27 21:06:46.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:22 2007 +
    Last update Tue Nov 27 21:06:44 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_uni.html dmd-1.024/dmd/html/d/phobos/std_uni.html --- dmd-1.023/dmd/html/d/phobos/std_uni.html 2007-10-05 00:37:24.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_uni.html 2007-11-27 21:06:46.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:22 2007 +
    Last update Tue Nov 27 21:06:44 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_uri.html dmd-1.024/dmd/html/d/phobos/std_uri.html --- dmd-1.023/dmd/html/d/phobos/std_uri.html 2007-10-05 00:37:24.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_uri.html 2007-11-27 21:06:46.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:22 2007 +
    Last update Tue Nov 27 21:06:44 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_utf.html dmd-1.024/dmd/html/d/phobos/std_utf.html --- dmd-1.023/dmd/html/d/phobos/std_utf.html 2007-10-05 00:37:24.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_utf.html 2007-11-27 21:06:46.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:22 2007 +
    Last update Tue Nov 27 21:06:44 2007
    @@ -150,7 +150,7 @@

    -
    uint idx; +
    size_t idx;
    index in string of where error occurred

    diff -uNr dmd-1.023/dmd/html/d/phobos/std_windows_charset.html dmd-1.024/dmd/html/d/phobos/std_windows_charset.html --- dmd-1.023/dmd/html/d/phobos/std_windows_charset.html 2007-10-05 00:37:24.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_windows_charset.html 2007-11-27 21:06:46.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:22 2007 +
    Last update Tue Nov 27 21:06:44 2007
    diff -uNr dmd-1.023/dmd/html/d/phobos/std_zip.html dmd-1.024/dmd/html/d/phobos/std_zip.html --- dmd-1.023/dmd/html/d/phobos/std_zip.html 2007-10-05 00:37:20.000000000 +0200 +++ dmd-1.024/dmd/html/d/phobos/std_zip.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Fri Oct 5 00:37:19 2007 +
    Last update Tue Nov 27 21:06:42 2007
    @@ -177,7 +177,7 @@

    -
    DosFileTime time; +
    std.date.DosFileTime time;
    Read/Write: Last modified time of the member. It's in the DOS date/time format.

    diff -uNr dmd-1.023/dmd/html/d/phobos/std_zlib.html dmd-1.024/dmd/html/d/phobos/std_zlib.html --- dmd-1.023/dmd/html/d/phobos/std_zlib.html 2007-11-01 03:02:34.000000000 +0100 +++ dmd-1.024/dmd/html/d/phobos/std_zlib.html 2007-11-27 21:06:44.000000000 +0100 @@ -29,7 +29,7 @@ -
    Last update Thu Nov 1 03:02:33 2007 +
    Last update Tue Nov 27 21:06:42 2007
    diff -uNr dmd-1.023/dmd/html/d/template.html dmd-1.024/dmd/html/d/template.html --- dmd-1.023/dmd/html/d/template.html 2007-10-05 00:38:22.000000000 +0200 +++ dmd-1.024/dmd/html/d/template.html 2007-11-27 21:19:32.000000000 +0100 @@ -25,8 +25,7 @@
    -
    -
    Last update Fri Oct 5 00:38:20 2007 +
    Last update Tue Nov 27 21:19:30 2007
    @@ -145,49 +144,11 @@ TemplateParameter , TemplateParameterList TemplateParameter: - TemplateTypeParameter - TemplateValueParameter - TemplateAliasParameter - TemplateTupleParameter + TemplateTypeParameter + TemplateValueParameter + TemplateAliasParameter + TemplateTupleParameter -TemplateTypeParameter: - Identifier - Identifier TemplateTypeParameterSpecialization - Identifier TemplateTypeParameterDefault - Identifier TemplateTypeParameterSpecialization TemplateTypeParameterDefault - -TemplateTypeParameterSpecialization: - : Type - -TemplateTypeParameterDefault: - = Type - -TemplateValueParameter: - Declaration - Declaration TemplateValueParameterSpecialization - Declaration TemplateValueParameterDefault - Declaration TemplateValueParameterSpecialization TemplateValueParameterDefault - -TemplateValueParameterSpecialization: - : ConditionalExpression - -TemplateValueParameterDefault: - = ConditionalExpression - -TemplateAliasParameter: - alias Identifier - alias Identifier TemplateAliasParameterSpecialization - alias Identifier TemplateAliasParameterDefault - alias Identifier TemplateAliasParameterSpecialization TemplateAliasParameterDefault - -TemplateAliasParameterSpecialization: - : Type - -TemplateAliasParameterDefault: - = Type - -TemplateTupleParameter: - Identifier ...

    The body of the TemplateDeclaration must be syntactically correct @@ -415,25 +376,22 @@ // (3) U is B -

    Value Parameters

    +

    Template Type Parameters

    -

    This example of template foo has a value parameter that - is specialized for 10: -

    +
    TemplateTypeParameter:
    +	Identifier
    +	Identifier TemplateTypeParameterSpecialization
    +	Identifier TemplateTypeParameterDefault
    +	Identifier TemplateTypeParameterSpecialization TemplateTypeParameterDefault
     
    -
    template foo(U : int, int T : 10)
    -{
    -    U x = T;
    -}
    +TemplateTypeParameterSpecialization:
    +	 : Type
     
    -void main()
    -{
    -    assert(foo!(int, 10).x == 10);
    -}
    +TemplateTypeParameterDefault:
    +	 = Type
     
    - -

    Specialization

    +

    Specialization

    Templates may be specialized for particular types of arguments by following the template parameter identifier with a : and the @@ -460,7 +418,55 @@ If the result is ambiguous, it is an error.

    -

    Alias Parameters

    + + + +

    Template Value Parameters

    + +
    TemplateValueParameter:
    +	Declaration
    +	Declaration TemplateValueParameterSpecialization
    +	Declaration TemplateValueParameterDefault
    +	Declaration TemplateValueParameterSpecialization TemplateValueParameterDefault
    +
    +TemplateValueParameterSpecialization:
    +	 : ConditionalExpression
    +
    +TemplateValueParameterDefault:
    +	 = ConditionalExpression
    +
    +
    + +

    This example of template foo has a value parameter that + is specialized for 10: +

    + +
    template foo(U : int, int T : 10)
    +{
    +    U x = T;
    +}
    +
    +void main()
    +{
    +    assert(foo!(int, 10).x == 10);
    +}
    +
    + + +

    Template Alias Parameters

    + +
    TemplateAliasParameter:
    +	alias Identifier
    +	alias Identifier TemplateAliasParameterSpecialization
    +	alias Identifier TemplateAliasParameterDefault
    +	alias Identifier TemplateAliasParameterSpecialization TemplateAliasParameterDefault
    +
    +TemplateAliasParameterSpecialization:
    +	 : Type
    +
    +TemplateAliasParameterDefault:
    +	 = Type
    +

    Alias parameters enable templates to be parameterized with any type of D symbol, including global names, local names, typedef names, @@ -568,39 +574,12 @@ -

    Template Parameter Default Values

    - -

    Trailing template parameters can be given default values: -

    - -
    template Foo(T, U = int) { ... }
    -Foo!(uint,long); // instantiate Foo with T as uint, and U as long
    -Foo!(uint);	 // instantiate Foo with T as uint, and U as int
    -
    -template Foo(T, U = T*) { ... }
    -Foo!(uint);	 // instantiate Foo with T as uint, and U as uint*
    -
    - -

    Implicit Template Properties

    - -

    If a template has exactly one member in it, and the name of that - member is the same as the template name, that member is assumed - to be referred to in a template instantiation: -

    - -
    template Foo(T)
    -{
    -    T Foo;	// declare variable Foo of type T
    -}
    +

    Template Tuple Parameters

    -void test() -{ - Foo!(int) = 6; // instead of Foo!(int).Foo -} +
    TemplateTupleParameter:
    +	Identifier ...
     
    -

    Tuple Parameters

    -

    If the last template parameter in the TemplateParameterList is declared as a TemplateTupleParameter, it is a match with any trailing template arguments. @@ -722,6 +701,37 @@ without a tuple parameter exactly match a template instantiation, the template without a TemplateTupleParameter is selected.

    +

    Template Parameter Default Values

    + +

    Trailing template parameters can be given default values: +

    + +
    template Foo(T, U = int) { ... }
    +Foo!(uint,long); // instantiate Foo with T as uint, and U as long
    +Foo!(uint);	 // instantiate Foo with T as uint, and U as int
    +
    +template Foo(T, U = T*) { ... }
    +Foo!(uint);	 // instantiate Foo with T as uint, and U as uint*
    +
    + +

    Implicit Template Properties

    + +

    If a template has exactly one member in it, and the name of that + member is the same as the template name, that member is assumed + to be referred to in a template instantiation: +

    + +
    template Foo(T)
    +{
    +    T Foo;	// declare variable Foo of type T
    +}
    +
    +void test()
    +{
    +    Foo!(int) = 6;	// instead of Foo!(int).Foo
    +}
    +
    +

    Class Templates

    ClassTemplateDeclaration:
    @@ -751,6 +761,12 @@
     }
     
    +

    Struct, Union, and Interface Templates

    + +

    Analogously to class templates, struct, union and interfaces + can be transformed into templates by supplying a parameter list. +

    +

    Function Templates

    If a template declares exactly one member, and that member is a function @@ -876,8 +892,7 @@ Copyright © 1999-2007 by Digital Mars, All Rights Reserved | Page generated by Ddoc. | -Comments +Comments

    char[] addr