Thread overview | |||||
---|---|---|---|---|---|
|
July 14, 2011 wrapping a void* by a ubyte[] array? | ||||
---|---|---|---|---|
| ||||
Is there any way of wrapping a void* by a ubyte[] array? The void* comes from mmap. |
July 14, 2011 Re: wrapping a void* by a ubyte[] array? | ||||
---|---|---|---|---|
| ||||
Posted in reply to teo | On Thu, 14 Jul 2011 17:07:20 +0200, teo <teo.ubuntu@yahoo.com> wrote: > Is there any way of wrapping a void* by a ubyte[] array? The void* comes > from mmap. byte[] array = cast(ubyte[])mmap(addr, length, ...)[0..length;] -- Simen |
July 14, 2011 Re: wrapping a void* by a ubyte[] array? | ||||
---|---|---|---|---|
| ||||
Posted in reply to teo | Cast to ubyte* and slice? ubyte[] array = (cast(ubyte*)pointer)[0..length]; "teo" <teo.ubuntu@yahoo.com> wrote in message news:ivn0n8$14ig$1@digitalmars.com... > Is there any way of wrapping a void* by a ubyte[] array? The void* comes from mmap. |
Copyright © 1999-2021 by the D Language Foundation