Pointerless Pointers

Era Scarecrow rtcvb32 at yahoo.com
Wed Jul 16 14:40:46 PDT 2008


 Question, this had come up in my head a few days ago and i'm curious if it would be useful, or useful enough to use.

 Using pointerless pointers you would use a template, and a pointer pair values which would probably be done internally to DMD.

 struct pp{
 int ppIndex;
 int offset;
}

then using a table that the GC keeps track of, will add it's appropriate locations from the heap where it's being used.

void *_PP[];  //somewhere internal.

 Now say that we're using pointerless pointers on a task with a lot of new's/delete's, and we get low on memory, it will start shifting data so it's all in one place, freeing up larger chunks of unused space, since we're using PP's,  the _PP table is updated but the pp's don't have to be, and even if you had a absolute address, when kept track and split into it's index and offset, none of the other data should be compromised.

 Would this be possibly workable?

 Era


More information about the Digitalmars-d-learn mailing list