Pointerless Pointers

BCS ao at pathlink.com
Wed Jul 16 14:49:17 PDT 2008


Reply to Era,

> 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
> 

M$ played around with something like that in at least one version (7.00) 
of there c/c++ compiler. They called them based pointers. Aside from that 
(and that it seems they didn't catch on) I don't known anything about them.




More information about the Digitalmars-d-learn mailing list