October 16, 2016 Re: UDA and trait for non-GC managed pointers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nordlöw | On Sat, 15 Oct 2016 16:22:35 +0000, Nordlöw wrote:
> Is there a way to check if a pointer is supposed to point to non-GC allocated memory?
You can check if it *does* point to GC-allocated memory if you use GC internals -- the Pool struct is what you want to look at, and the lookup methods associated with it.
|
October 16, 2016 Re: UDA and trait for non-GC managed pointers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Chris Wright | On Sunday, 16 October 2016 at 04:14:42 UTC, Chris Wright wrote:
> On Sat, 15 Oct 2016 16:22:35 +0000, Nordlöw wrote:
>
>> Is there a way to check if a pointer is supposed to point to non-GC allocated memory?
>
> You can check if it *does* point to GC-allocated memory if you use GC internals -- the Pool struct is what you want to look at, and the lookup methods associated with it.
That's in run-time, though. I want it in compile-time so we can optimize away calls to GC.{add,Remove}Range. And that we don't have yet.
Thanks anyway.
|
October 17, 2016 Re: [OT] Re: UDA and trait for non-GC managed pointers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Basile B. | On 10/15/2016 02:50 PM, Basile B. wrote: > > I've given up with the idea of proposing my stuff in phobos. About > memory there would also have be: > - allocators-based factory (https://github.com/dlang/phobos/pull/4062) > - @nogc dispose (https://github.com/dlang/phobos/pull/4351) > > But each time the PR was a failure. Since last spring I've stopped to > think that my stuff would be useful and I hole up in my user library. > > Even some simple bug fixes can be completely ignored during weeks, even > if reviewed: > - https://github.com/dlang/phobos/pull/4439 > - https://github.com/dlang/phobos/pull/4475 > - https://github.com/dlang/phobos/pull/4296 > > After a while it becomes clears that it's a loss of time. Mere weeks? Try over a year: https://github.com/dlang/dmd/pull/4745 |
Copyright © 1999-2021 by the D Language Foundation