Author Topic: error with the latest Oxygen DLL  (Read 11965 times)

0 Members and 2 Guests are viewing this topic.

Aurel

  • Guest
Re: error with the latest Oxygen DLL
« Reply #30 on: April 25, 2014, 06:04:14 AM »
Quote
Some of the expressions you use generate complex assembly code.
Heh...
I have just one parser routine and few processing functions.
This one which create problems is from expression evaluator which original version
is created in PureBasic.
(In PureBasic this evaluator work extremly fast, it looks that is PB very fast with strings)
Hmmm why i use this evaluator?
Simply because is fast and don't create memory leaks.
As i say before with DLL which i currently use work fine and properly.
This message 'No Source' is ok  ...so if you drag source file & drop into
this compiled exe(ruben2.exe)  program is executed.
ok time to try... ;)

Aurel

  • Guest
Re: error with the latest Oxygen DLL
« Reply #31 on: April 25, 2014, 06:09:32 AM »
Charles
When i try to download dll from a given link i get this error msg ...
do you change something?

.

Charles Pegge

  • Guest
Re: error with the latest Oxygen DLL
« Reply #32 on: April 25, 2014, 09:30:56 AM »
Sorry, it was meant to be zip rather than dll. Same as the previous.

I can see quite a few ways of boosting performance. For instance getting the next ascii code instead of getchar. Evaluating integers is much faster.


Aurel

  • Guest
Re: error with the latest Oxygen DLL
« Reply #33 on: April 25, 2014, 10:19:22 PM »
Quote
Evaluating integers is much faster

Hi Charles
Yes i agree But i already tried to implement your evaluator which is from my opinion
great but produce somehow mem leaks .
Only this evaluator don't produce mem leak ..how or why i don't know.
Maybe some sort of combination will work faster without leak ..

Anyway ...thank you very much on new DLL  ;)
In attachment is a interpreter with few programs just to test Drag & Drop execution
 :)

.

Aurel

  • Guest
Re: error with the latest Oxygen DLL
« Reply #34 on: April 26, 2014, 06:24:29 AM »
Anyone ...
is drag & drop work on your computer or not ?
thanks

Charles Pegge

  • Guest
Re: error with the latest Oxygen DLL
« Reply #35 on: April 26, 2014, 08:18:04 AM »
Hi Aurel,

yes that is working nicely on Vista, thanks.

I'll see what can be done with Ascii vs Chars. It is easier to make gradual changes, rather than do something radical.

Aurel

  • Guest
Re: error with the latest Oxygen DLL
« Reply #36 on: April 26, 2014, 09:00:15 AM »
Quote
I'll see what can be done with Ascii vs Chars. It is easier to make gradual changes, rather than do something radical.

Yes i agree ,and you know this things far better than me.

Charles Pegge

  • Guest
Re: error with the latest Oxygen DLL
« Reply #37 on: April 26, 2014, 01:36:26 PM »

An example of string elimination, producing more efficient binary

Before:

Code: [Select]
Function GetNum() as float
'print "SUB->GETNUM"
  STRING Temp
 
    If Asc(look) > 47 and Asc(look) < 58  ' read chars as numbers
       'print "need number"
    End if

While (Asc(Look) > 47 And Asc(Look) < 58) Or Asc(Look) = 46' dec.point
Temp = Temp + Look
Gosub getchar
         'print "GetNum-TEMP:" + Temp
Wend
       
  Return Val(Temp)
End Function

After:

Code: [Select]
Function GetNum() as double
 'print "SUB->GETNUM"
  sys c
  byte *m=StreamPos-2+strptr(Stream)
  do
    select m
      case "."        : 'ok
      case "0" to "9" : 'ok
      case else       : exit do
    end select
    @m++
    c++
  end do
  if c
    StreamPos+=c-1
    GetChar
    return Val((bstring) @b)
  end if
End Function

GetChar is used to fit in with the rest of your program.


Charles Pegge

  • Guest
Re: error with the latest Oxygen DLL
« Reply #38 on: April 26, 2014, 02:52:52 PM »
I've just plugged a memory leak associated with returning the ascii or val of a string expression. It's very specific. Examples:

return val(s+t)

return asc( mid(s,i,1) )


Thanks for exposing it, Aurel.

direct link for Oxygen.dll:
http://www.oxygenbasic.org/o2zips/Oxygen.zip


Aurel

  • Guest
Re: error with the latest Oxygen DLL
« Reply #39 on: April 26, 2014, 02:54:26 PM »
Hmm
I think that i understand ...you use byte pointer
Ok i will try ...thanks  :)

Aurel

  • Guest
Re: error with the latest Oxygen DLL
« Reply #40 on: April 26, 2014, 02:57:04 PM »
Charles...
I am confused now  ???
Is that mean that your method create memory leak
OR
you find memory leak in last DLL ?

Charles Pegge

  • Guest
Re: error with the latest Oxygen DLL
« Reply #41 on: April 26, 2014, 03:08:36 PM »
It's a DLL fix. I found it by chance, when scruinising the Asm generated by string returns. The return jumped over the Temp-string garbage collector, instead of calling it.

It does not affect the code I posted above.

Aurel

  • Guest
Re: error with the latest Oxygen DLL
« Reply #42 on: April 26, 2014, 03:25:41 PM »
ok  ;)

Aurel

  • Guest
Re: error with the latest Oxygen DLL
« Reply #43 on: April 27, 2014, 02:11:35 AM »
sorry Charles
But now is something wrong with compiled exes...not only with ruben interpreter then also with
ASciEdit to...
it looks that is something in conflict with win api becuse application crush when event is
triggered..for example after FileDialog  or compile button is clicked.. ???
In package is old dll too.


And Charles
it looks that your version of GetNum not work
oxygen say ...there is no variable b
Code: [Select]
Function GetNum() as double
 'print "SUB->GETNUM"
  sys c
  byte *m=StreamPos-2+strptr(Stream)
  do
    select m
      case "."        : 'ok
      case "0" to "9" : 'ok
      case else       : exit do
    end select
    @m++
    c++
  end do
  if c
    StreamPos+=c-1
    GetChar
    return Val((bstring) @b)
  end if
End Function

I look again and replace b with m and again not work for api graphics
what is really strange  :o
then i replace this function with old and work  ???
very very weird ...


.

Charles Pegge

  • Guest
Re: error with the latest Oxygen DLL
« Reply #44 on: April 27, 2014, 02:54:35 AM »
Yes, sorry, there's missing lines. My code-pruning was overdone.

byte *b
@b=@m


Code: [Select]
Function GetNum() as double
 'print "SUB->GETNUM"
  sys c
  byte *m=StreamPos-2+strptr(Stream)
  byte*b
  @b=@m
  do
    select m
      case "."        : 'ok
      case "0" to "9" : 'ok
      case else       : exit do
    end select
    @m++
    c++
  end do
  if c
    StreamPos+=c-1
    GetChar
    return Val((bstring) @b)
  end if
End Function