August 22, 2004 Re: Syntax for pinning | ||||
---|---|---|---|---|
| ||||
Posted in reply to antiAlias | In article <cgajm4$tas$1@digitaldaemon.com>, antiAlias says... > >Don't wish to be a party-pooper Jill, but asking Walter to reserve syntax for a 'feature' that's not implemented is inviting trouble for D; simply because it's typically rather difficult to "pin-down" exactly how pinning will work until the requisite time and effort has been spent to figure out how the whole thing will operate. You have a very good point. I was assuming that Walter already had the implementation in mind, but I guess I shouldn't have assumed that. >It may turn out that Walter /does/ know >exactly how it will operate, but if not then your asking him to tie his own >hands over something that provides perhaps zero value right now. Yes, you're right aren't you. Well yeah - if the mechanism isn't know, we can't add the syntax yet. Totally fair enough. >Is it possible for you to 'mark' these arrays using an alias, typedef, or template instead? It would then be trivial to patch them later, without having to remember which ones should be pinned. Actually, there's really only one place in my code that needs it, so I won't have any trouble remembering it. Thanks for the suggestion though. Arcane Jill |
August 23, 2004 Re: Syntax for pinning | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andy Friesen | "Andy Friesen" <andy@ikagames.com> wrote in message news:cgadrn$qf8$1@digitaldaemon.com... > Martin wrote: > > I am in favor, because I use sometimes char * and other 'hacks' to access > > memory, so it wouldn't be very nice when memory suddenly would just run away. > > And I agree, that we need it now, pecause otherwise we need to do a lot of code > > rewriting when new version comes. > > Keywords 'pinned' and 'unpin' are ok, I think. 'pin', maybe not beacouse it is > > a 3 letter word, maybe 'pinmem'? > > Or whatever, but I agree that we need this and we need it now. > > 'pin' is terrible because it's a noun. "pin" is both noun and verb > 'unpin' is bad because it's a > verb. These are both perfectly reasonable variable/method names, and it > would be a crime to steal them from the programmer. ^ heavy > 'pinned', is more or less perfect: it's short and, since it's an adjective, it wouldn't be a very good variable or method name. 'pinned' also fits in nicely with the other attributes: > > protected static pinned char* ptr; > > I like the attribute style. Unlike separate pin/unpin statements, it leaves no opportunity for absent-mindedness to wreak havoc. :) > > -- andy |
August 23, 2004 Re: Syntax for pinning | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew | Matthew wrote: > "Andy Friesen" <andy@ikagames.com> wrote in message news:cgadrn$qf8$1@digitaldaemon.com... > >>Martin wrote: >> >>'pin' is terrible because it's a noun. > > "pin" is both noun and verb errr right. Brainfart. That makes it a pretty bad identifier, actually. (I still have nightmares about attributes and classes named 'query') >> 'unpin' is bad because it's a >>verb. These are both perfectly reasonable variable/method names, and it >>would be a crime to steal them from the programmer. > > ^ > heavy Whoops! -- Aspiring student of the English language |
August 23, 2004 Re: Syntax for pinning | ||||
---|---|---|---|---|
| ||||
Posted in reply to Arcane Jill | How about just a function call in the GC? Then we don't have to add new syntax. Walter could implement the following function (which would be a NOP in the current GC): void gc.pin(byte[] range); |
September 01, 2004 Re: Syntax for pinning | ||||
---|---|---|---|---|
| ||||
Posted in reply to Arcane Jill | Arcane Jill wrote: <snip> > Pinning is only needed for sophisticated memory management stuff (or > in my case, security). Rest assured you won't need it just to keep > pointers valid. You forgot interfacing with foreign code, crocky legacy APIs and the like.... http://www.digitalmars.com/drn-bin/wwwnews?D/26273 Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit. |
September 01, 2004 Re: Syntax for pinning | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthias Becker | Matthias Becker wrote: <snip> > Does it need to be a keyword? Perhaps normal functions in the library (in > std.gc) could do the work. > I'd like something like this: > > a = new uint[n]; > > { > auto Pin pin = new Pin(a); > .. > } Makes sense. As long as the class itself isn't auto, as that would probably break the ability to store such crocky things as Windows handles as class members without further dirty tricks.... Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit. |
Copyright © 1999-2021 by the D Language Foundation