Le 05/08/2012 18:33, Emil Lenngren a écrit :
> If there is a pending gosub + a catch, the gosub things on the stack are
> erased, so when returning back, invalid values are copied from the stack.
>
> So at stack unwinding, the gosub slots must be kept.
>
> This crashes the interpreter now (or puts
If there is a pending gosub + a catch, the gosub things on the stack are
erased, so when returning back, invalid values are copied from the stack.
So at stack unwinding, the gosub slots must be kept.
This crashes the interpreter now (or puts it in an infinite loop):
Public Sub Main()
Dim i As
Le 23/07/2012 01:14, Emil Lenngren a écrit :
> It was this line I was worried about:
> while (SP > (BP + FP->n_local + FP->n_ctrl))
>
> /Emil
>
I think it's ok... Failing during a Gosub is not different from failing
inside a deep expression evaluation.
--
Benoît Minisini
--
It was this line I was worried about:
while (SP > (BP + FP->n_local + FP->n_ctrl))
/Emil
2012/7/23 Benoît Minisini
> Le 23/07/2012 00:47, Emil Lenngren a écrit :
> > Does exception handling with Catch work as I stated before?
> >
> > I am at a hotel in Vienna with Wi-Fi now so I can't test it r
Le 23/07/2012 00:47, Emil Lenngren a écrit :
> Does exception handling with Catch work as I stated before?
>
> I am at a hotel in Vienna with Wi-Fi now so I can't test it right now :)
>
> /Emil
>
I didn't really test, but on the stack you have only:
- Valid stack slot for control variables.
- A
Does exception handling with Catch work as I stated before?
I am at a hotel in Vienna with Wi-Fi now so I can't test it right now :)
/Emil
2012/7/22 Benoît Minisini
> Le 09/07/2012 00:46, Emil Lenngren a écrit :
> > Just store it inside a T_POINTER?
> > val->type = T_POINTER;
> > val->_pointer
Le 09/07/2012 00:46, Emil Lenngren a écrit :
> Just store it inside a T_POINTER?
> val->type = T_POINTER;
> val->_pointer.value = PC;
>
> Or whatever big enough datatype that doesn't do anything on RELEASE.
>
Your idea has been implemented in revision #4979!
Regards,
--
Benoît Minisini
---
Just store it inside a T_POINTER?
val->type = T_POINTER;
val->_pointer.value = PC;
Or whatever big enough datatype that doesn't do anything on RELEASE.
2012/7/9 Benoît Minisini
> Le 09/07/2012 00:13, Emil Lenngren a écrit :
> > I have a little optimization idea:
> >
> > Instead of allocating a
Le 09/07/2012 00:13, Emil Lenngren a écrit :
> I have a little optimization idea:
>
> Instead of allocating a new array EVERY time a gosub is called, instead use
> the normal gambas stack.
> First, let GP represent the offset 0 in &BP[fp->n_local + fp->n_ctrl].
>
> At a gosub, run STACK_check(1 + f
I have a little optimization idea:
Instead of allocating a new array EVERY time a gosub is called, instead use
the normal gambas stack.
First, let GP represent the offset 0 in &BP[fp->n_local + fp->n_ctrl].
At a gosub, run STACK_check(1 + fp->stack_usage - fp->n_local), then the
return address an
On 03/05/2012 09:00 PM, Benoît Minisini wrote:
> Le 06/03/2012 02:11, Emil Lenngren a écrit :
>> Yeah, if there is no stack relocation, I can assume that a lot of pointers
>> into the stack will not change during other external calls, which should
>> make code more optimized.
>>
>> Since local vari
Le 06/03/2012 02:11, Emil Lenngren a écrit :
> Yeah, if there is no stack relocation, I can assume that a lot of pointers
> into the stack will not change during other external calls, which should
> make code more optimized.
>
> Since local variables and stack frames in gambas take up more space th
Yeah, if there is no stack relocation, I can assume that a lot of pointers
into the stack will not change during other external calls, which should
make code more optimized.
Since local variables and stack frames in gambas take up more space than
they do in C, I think the stack should be bit bigge
That code seems old and is not used I think. If it is used, it is not used
correctly :)
Because the stack can eat up all my memory if I do a lot of recursion.
2012/3/6 Benoît Minisini
> Le 06/03/2012 02:00, Benoît Minisini a écrit :
> >
> > Maybe I should use getrlimit(RLIMIT_STACK, ...) to get
Le 06/03/2012 02:00, Benoît Minisini a écrit :
>
> Maybe I should use getrlimit(RLIMIT_STACK, ...) to get the maximum C
> stack limit, and use it as the maximum Gambas stack limit too?
>
Hu... I'm already doing that...
--
Benoît Minisini
-
Le 05/03/2012 18:28, Emil Lenngren a écrit :
> It is no strange at all that stack reallocation is slower and slower
> as the recursion gets deeper. Because when the stack has to be
> resized, a new memory area is allocated and the old stack is copied
> over to the new, and the old gets freed. As t
Simple answer: yes
Complex answer: yes
-- Original Message ---
From: Ru Vuott
To: mailing list for gambas users
Sent: Sun, 4 Mar 2012 15:23:24 + (GMT)
Subject: Re: [Gambas-user] Gambas has Gosub now!
> > But I get a compile error:
> > error: 'TRANS_GO
It is no strange at all that stack reallocation is slower and slower as the
recursion gets deeper. Because when the stack has to be resized, a new
memory area is allocated and the old stack is copied over to the new, and
the old gets freed. As the recursion gets deeper, more and more data has to
be
Le 04/03/2012 10:16, Benoît Minisini a écrit :
> Le 04/03/2012 02:23, Benoît Minisini a écrit :
>>
>> You are right, I didn't think about that. So the current design does not
>> work, and I don't have another one.
>>
>> I will remove GOSUB if it cannot be implemented in a right way. :-/
>>
>> Regar
Why not try:
RETURN label:
It looks like a function return value but "label:" can only be a label, yes
On 04/03/2012, Benoît Minisini wrote:
> Le 04/03/2012 17:35, Jussi Lahtinen a écrit :
>> Maybe there should be "GoBack" instead of "Return".
>> We already have "GoTo" and "GoSub", so I think i
Le 04/03/2012 17:35, Jussi Lahtinen a écrit :
> Maybe there should be "GoBack" instead of "Return".
> We already have "GoTo" and "GoSub", so I think it would be logical...
>
> Jussi
>
Yes, but RETURN is the historical syntax in Basic.
And I don't think it's a problem if you cannot return from the
Le 04/03/2012 15:23, Emil Lenngren a écrit :
> Nice, to me it looks like that design works ;)
>
> But I get a compile error:
> error: 'TRANS_GOTO' has no member named 'gosub'
>
> I assume the "share" folder was not commited to svn...
> When I add "bool gosub" to the gbc_trans_common.h, it works.
>
Maybe there should be "GoBack" instead of "Return".
We already have "GoTo" and "GoSub", so I think it would be logical...
Jussi
2012/3/4 Benoît Minisini
> Le 04/03/2012 02:23, Benoît Minisini a écrit :
> >
> > You are right, I didn't think about that. So the current design does not
> > work,
I think they can be useful. They both speed up the code and let you have
"functions" inside functions that have access to all the local variables.
/Emil
2012/3/4 Ru Vuott
>
> > But I get a compile error:
> > error: 'TRANS_GOTO' has no member named 'gosub'
>
> I confirm this problem.
>
>
> A que
> But I get a compile error:
> error: 'TRANS_GOTO' has no member named 'gosub'
I confirm this problem.
A question: Is this GOSUB really so "incredibly" useful ?
Regards
Vuott
--
Virtualization & Cloud Management Using
Nice, to me it looks like that design works ;)
But I get a compile error:
error: 'TRANS_GOTO' has no member named 'gosub'
I assume the "share" folder was not commited to svn...
When I add "bool gosub" to the gbc_trans_common.h, it works.
Now a little bug:
Now the compiler thinks that all labels
Le 04/03/2012 02:23, Benoît Minisini a écrit :
>
> You are right, I didn't think about that. So the current design does not
> work, and I don't have another one.
>
> I will remove GOSUB if it cannot be implemented in a right way. :-/
>
> Regards,
>
Here is the only solution I found in revision #45
Superb work!
Bravo!
-- Original Message ---
From: Benoît Minisini
To: mailing list for gambas users
Sent: Sun, 04 Mar 2012 02:23:57 +0100
Subject: Re: [Gambas-user] Gambas has Gosub now!
> Le 04/03/2012 02:03, Emil Lenngren a écrit :
> > Nice work!
> > About
Le 04/03/2012 02:03, Emil Lenngren a écrit :
> Nice work!
> About "occupying" the Return keyword, why not simply use something like
> "Return Gosub" indicating that you only want to return from the Gosub, and
> not the whole function?
> And as I said before, the code inside a gosub must somehow use
Nice work!
About "occupying" the Return keyword, why not simply use something like
"Return Gosub" indicating that you only want to return from the Gosub, and
not the whole function?
And as I said before, the code inside a gosub must somehow use control
variables in a deeper depth or what you say, o
Hi,
I have just succeeded (I think) in implementing the old Basic GOSUB
instruction in Gambas in revision #4530.
I did that, because it is faster than using a plain little function, if
you just need to call a small piece code without needing a specific
context nor arguments.
The syntax is the
31 matches
Mail list logo