logical const idea - scratchspace

Alex Rønne Petersen xtzgzorex at gmail.com
Mon May 14 14:09:05 PDT 2012


On 14-05-2012 23:06, Alex Rønne Petersen wrote:
> On 14-05-2012 22:13, Steven Schveighoffer wrote:
>> On Mon, 14 May 2012 15:56:37 -0400, Alex Rønne Petersen
>> <xtzgzorex at gmail.com> wrote:
>>
>>> On 14-05-2012 21:51, Steven Schveighoffer wrote:
>>
>>>> It also should be recommended that the scratch space not contain any GC
>>>> pointers, since it's *not* participating in the type system properly,
>>>> the GC may not treat it as a pointer.
>>>
>>> That renders it useless for caching e.g. a string though...
>>
>> Yes, it does. Unless you know the size of the string (so you can allocate
>> enough scratch space to hold it).
>>
>> It's not perfect, for sure. But it might be better than nothing...
>>
>> -Steve
>
> But is there any reason we can't just have the GC check the scratch
> space? If it's all zero, it clearly contains nothing of interest, but if
> it's non-zero, just scan it like regular object memory.
>

Further, we could use a user marking scheme where writing anything 
non-zero to the space flags it "dirty" or something. There are probably 
lots of ways we could do this.

-- 
- Alex


More information about the Digitalmars-d mailing list