View mode: basic / threaded / horizontal-split · Log in · Help
March 02, 2012
How to indicate that a memory block contains no GC pointers?
Hi,

Is there any way I can tell the GC that a block of memory does not 
contain any possible pointers (in)to other GC-managed memory?

-- 
- Alex
March 02, 2012
Re: How to indicate that a memory block contains no GC pointers?
On 03/02/2012 12:48 PM, Alex Rønne Petersen wrote:
> Hi,
>
> Is there any way I can tell the GC that a block of memory does not
> contain any possible pointers (in)to other GC-managed memory?
>

Everything about the GC should be in the core.memory module. I think 
what you need is removeRange(). Or you can specify the same if you 
allocate the memory explicitly:

  int * p = cast(int*)GC.calloc(100, GC.BlkAttr.NO_SCAN);

Ali
March 02, 2012
Re: How to indicate that a memory block contains no GC pointers?
On 02-03-2012 21:54, Ali Çehreli wrote:
> On 03/02/2012 12:48 PM, Alex Rønne Petersen wrote:
>> Hi,
>>
>> Is there any way I can tell the GC that a block of memory does not
>> contain any possible pointers (in)to other GC-managed memory?
>>
>
> Everything about the GC should be in the core.memory module. I think
> what you need is removeRange(). Or you can specify the same if you
> allocate the memory explicitly:
>
> int * p = cast(int*)GC.calloc(100, GC.BlkAttr.NO_SCAN);
>
> Ali

Ah, exactly what I needed. Thanks!

-- 
- Alex
Top | Discussion index | About this forum | D home