Re: A array bug?

2009-02-04 Thread Stewart Gordon
Ellery Newcomer wrote: taqya wrote: char[] a = "a".dup; char[] b = "b".dup; writefln(a + b); //Error: Array operations not implemented If so, the error informs you why you can't do that. Except that it doesn't. "Array operations not implemented" is a leftover from a previou

Re: switch off GC?

2009-02-04 Thread Weed
bearophile пишет: > Weed, some built-ins and significant part of the standard lib (and other libs > you can find around) assume the presence of a GC. Right. For example, return from function of a dynamic array will not work correctly without GC - there will be a memory leak. > So you can disable

Re: C struct -> D struct (alignment hacks)

2009-02-04 Thread Mike
On Wed, 04 Feb 2009 21:04:16 +0100, Jarrett Billingsley wrote: Nope. The C struct is defining a bitfield; a and b will actually be contained within a single 4-byte field. Your D version defines three integers. Unfortunately the C specification does not specify any required ordering for bit

Re: C struct -> D struct (alignment hacks)

2009-02-04 Thread Jarrett Billingsley
On Wed, Feb 4, 2009 at 2:55 PM, Mike wrote: > Hi! > > I'm in the process of translating some C headers (still ffmpef -> libavcode > and libavformat) to D and there are some really ugly structs in the C > headers which I'm trying to translate. > > - C - > > typedef struct xy > { >int a:1; >

C struct -> D struct (alignment hacks)

2009-02-04 Thread Mike
Hi! I'm in the process of translating some C headers (still ffmpef -> libavcode and libavformat) to D and there are some really ugly structs in the C headers which I'm trying to translate. - C - typedef struct xy { int a:1; int b:2; int c; } - D - struct xy { align (1)

Re: Deleting an element from an array

2009-02-04 Thread Saaa
Please tell me when I got something wrong : ) >>> >>> arr = arr[ 0 .. lowerBound ] ~ arr[ upperBound .. $ ]; >>> >> >> That's simple enough, but inefficient. Because it loops over arr.length-2 and copies the pointers. Will the compiler optimize by not copying the [0..lowerbound] part? And will the

Re: switch off GC?

2009-02-04 Thread Chris Nicholson-Sauls
Tim M wrote: On Wed, 04 Feb 2009 15:38:45 +1300, Weed wrote: It is possible to disable GC? That it has not been included in result binary for an increasing performance of ref operations and reduction of the size of the binary I have not found the answer in google. To anyone here that disa

Re: switch off GC?

2009-02-04 Thread bearophile
Weed, some built-ins and significant part of the standard lib (and other libs you can find around) assume the presence of a GC. So you can disable (or often just not use it. If you don't allocate/free GC-managed memory then the GC sleeps) in some critical spots of your code as I do (and you can

Re: switch off GC?

2009-02-04 Thread Tim M
On Wed, 04 Feb 2009 15:38:45 +1300, Weed wrote: It is possible to disable GC? That it has not been included in result binary for an increasing performance of ref operations and reduction of the size of the binary I have not found the answer in google. To anyone here that disables there GC: