Oxygen Basic

Information => Development => Topic started by: Arnold on January 28, 2015, 08:14:42 AM

Title: Memory leaks with TypeDefProc.o2bas?
Post by: Arnold on January 28, 2015, 08:14:42 AM
Hi Charles,

what is the purpose of \examples\Constructs\TypeDefProc.o2bas? It looks very complicated.

When I try to run the demo, this does fail. When I use TaskManager and look at the process gxo2.exe, I see that the used memory increases until gxo2.exe crashes or until I kill the process.

Is there a logical error in the source code?


Roland
Title: Re: Memory leaks with TypeDefProc.o2bas?
Post by: Charles Pegge on January 28, 2015, 01:30:11 PM
Roland,

An unfortunate C'ism. I will consign it to the buggy folder!

Avoiding typedef functions:

Code: OxygenBasic
  1. function f(sys a) as sys label
  2. print a
  3. end function
  4.  
  5. declare function ptr g(sys a)
  6. '!* g(sys a)
  7. 'void (*g)(sys a)
  8.  
  9. @g=@f
  10. g 45
  11.  


The constructs folder, contains quite a lot of experimental stuff.