On 2013/08/13 01:02:09, brainman wrote: > windows part LGTM. > > Even better then I ...
12 years, 4 months ago
(2013-08-13 10:11:53 UTC)
#6
On 2013/08/13 01:02:09, brainman wrote:
> windows part LGTM.
>
> Even better then I expected - you're actually decommitting memory.
I've tested with MEM_RESET, and it does not actually help -- I started N
processes, each process pages in 1GB of memory and them marks it as MEM_RESET.
It still kills my machine. With MEM_DECOMMIT it works perfectly, even RSS drops
in task manager (not the case with MEM_RESET).
On 2013/08/13 10:11:53, dvyukov wrote: > > I've tested with MEM_RESET, and it does not ...
12 years, 4 months ago
(2013-08-13 11:52:28 UTC)
#7
On 2013/08/13 10:11:53, dvyukov wrote:
>
> I've tested with MEM_RESET, and it does not actually help -- I started N
> processes, each process pages in 1GB of memory and them marks it as MEM_RESET.
> It still kills my machine. With MEM_DECOMMIT it works perfectly, even RSS
drops
> in task manager (not the case with MEM_RESET).
Yes, Windows does care about committed memory.
Alex
https://codereview.appspot.com/12720043/diff/10001/src/pkg/runtime/mem_plan9.c File src/pkg/runtime/mem_plan9.c (right): https://codereview.appspot.com/12720043/diff/10001/src/pkg/runtime/mem_plan9.c#newcode61 src/pkg/runtime/mem_plan9.c:61: USED(v, nbytes); On 2013/08/12 10:36:03, dvyukov wrote: > On ...
12 years, 4 months ago
(2013-08-15 00:02:12 UTC)
#9
Message was sent while issue was closed.
https://codereview.appspot.com/12720043/diff/10001/src/pkg/runtime/mem_plan9.c
File src/pkg/runtime/mem_plan9.c (right):
https://codereview.appspot.com/12720043/diff/10001/src/pkg/runtime/mem_plan9....
src/pkg/runtime/mem_plan9.c:61: USED(v, nbytes);
On 2013/08/12 10:36:03, dvyukov wrote:
> On 2013/08/12 10:07:34, chai2010 wrote:
> > typo ?
> >
> > USED(v);
> > USED(n);
>
> I've done it as it is done few lines above and few lines below in this file.
Sorry for this question again.
I can't find the var `nbytes` in this func,
maybe it should change the `n` argument to `nbytes`?
PS:
where is the manual about the `USED` macro?
I can't understand it multi-args behavior.
Thanks.
On 2013/08/15 00:02:12, chai2010 wrote: > Sorry for this question again. > I can't find ...
12 years, 4 months ago
(2013-08-15 00:11:09 UTC)
#10
Message was sent while issue was closed.
On 2013/08/15 00:02:12, chai2010 wrote:
> Sorry for this question again.
> I can't find the var `nbytes` in this func,
> maybe it should change the `n` argument to `nbytes`?
>
I don't understand your question. All functions are short here, so 'n' is a fine
variable name.
> where is the manual about the `USED` macro?
I don't know. Did you look in $GOROOT/include? Just look and you will find.
> I can't understand it multi-args behavior.
Never used it in such way. But, if you find the source, you can see it for
yourself.
Alex
On 2013/08/15 00:11:09, brainman wrote: > On 2013/08/15 00:02:12, chai2010 wrote: > > Sorry for ...
12 years, 4 months ago
(2013-08-15 09:40:58 UTC)
#11
Message was sent while issue was closed.
On 2013/08/15 00:11:09, brainman wrote:
> On 2013/08/15 00:02:12, chai2010 wrote:
> > Sorry for this question again.
> > I can't find the var `nbytes` in this func,
> > maybe it should change the `n` argument to `nbytes`?
> >
>
> I don't understand your question. All functions are short here, so 'n' is a
fine
> variable name.
>
> > where is the manual about the `USED` macro?
>
> I don't know. Did you look in $GOROOT/include? Just look and you will find.
>
> > I can't understand it multi-args behavior.
>
> Never used it in such way. But, if you find the source, you can see it for
> yourself.
>
> Alex
sorry for my poor english and poor knowledge.
I have 2 questions:
1. where is `nbytes` defined [3]?
runtime·SysUsed(void *v, uintptr n)
{
USED(v, nbytes); // what is `nbytes` ?
}
src/pkg/runtime/mem_plan9.c line61 [3]:
2. Does `USED` macro can support multi-arguments?
I look the `USED` defined code in the $GOROOT/include/libc.h:
/* compiler directives on plan 9 */
#define SET(x) ((x)=0)
#define USED(x) if(x){}else{}
#ifdef __GNUC__
# if __GNUC__ >= 3
# undef USED
# define USED(x) ((void)(x))
# endif
#endif
`USED` only one argument, but mem_plan9.c used `USED` with two arguments[2,3,4]:
USED(v, nbytes);
after C preprocessor:
USED(v, nbytes) -> if(v, nbytes){}else{}
or
USED(v, nbytes) -> ((void)(v, nbytes))
Does comma expression (i don't know)?
Thanks!
Reference:
[1]
https://code.google.com/p/go/source/browse/include/libc.h#369
[2]
https://code.google.com/p/go/source/browse/src/pkg/runtime/mem_plan9.c#55
[3]
https://code.google.com/p/go/source/browse/src/pkg/runtime/mem_plan9.c#61
[4]
https://code.google.com/p/go/source/browse/src/pkg/runtime/mem_plan9.c#67
On 2013/08/15 09:40:58, chai2010 wrote: > > sorry for my poor english and poor knowledge. ...
12 years, 4 months ago
(2013-08-16 00:08:08 UTC)
#13
Message was sent while issue was closed.
On 2013/08/15 09:40:58, chai2010 wrote:
>
> sorry for my poor english and poor knowledge.
>
That is two of us :-)
>
> 2. Does `USED` macro can support multi-arguments?
>
> I look ...
>
> USED(v, nbytes) -> if(v, nbytes){}else{}
> or
> USED(v, nbytes) -> ((void)(v, nbytes))
>
Both looks fine to me. So not more magic.
Alex
>> 2. Does `USED` macro can support multi-arguments? The runtime is not compiled using the ...
12 years, 4 months ago
(2013-08-16 01:10:31 UTC)
#14
>> 2. Does `USED` macro can support multi-arguments?
The runtime is not compiled using the host compiler
so the macro defined in src/lib9 is not applicable.
In the Plan 9 C compilers, USED and SET are reserved
keywords that act like functions and expect zero or
more arguments (which must be either variable names
or & expressions).
Anthony
Issue 12720043: code review 12720043: runtime: implement SysUnused on windows
(Closed)
Created 12 years, 4 months ago by dvyukov
Modified 12 years, 4 months ago
Reviewers: chai2010, brainman, ality
Base URL:
Comments: 7