It is currently Mon Sep 23, 2019 8:55 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 82 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6
Author Message
 Post subject: Re: PureBasic 5.71 LTS is out !
PostPosted: Sat Aug 17, 2019 9:46 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 13, 2010 3:45 pm
Posts: 892
skywalk wrote:
I never use #Null$. What is the downside if I continue to let PB manage its internal string buffers? Is there a memory leak or just excess memory use?

#Null$ is needed for some APIs

_________________
sorry for my bad english


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic 5.71 LTS is out !
PostPosted: Sat Aug 17, 2019 10:57 am 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 1915
Location: Germany
If you work a lot with Pointers and AllocateMemory it can lead to memory leaks.

With global variables it is not so critical yet, because they are overwritten again and again. But you have to be careful with memory.

With ClearStructure you can completely clean up the memory. But if you want to release only one string in the structure of the memory completely, you can use the following trick.

With the version before PB v5.70 it was enough to assign #Null$ from releasing the resource.

Code:
Macro FreeStructureString(_struct_, _offset_)
  ClearStructure(_struct_ + _offset_, string)
EndMacro

Structure udtFoo
  iVal.i
  sVal.s
EndStructure

*mem.udtFoo = AllocateMemory(SizeOf(udtFoo))
*mem\iVal = 100
*mem\sVal = Space(1000000)
Debug PeekI(*mem + OffsetOf(udtFoo\sVal))
FreeStructureString(*mem, OffsetOf(udtFoo\sVal))
Debug PeekI(*mem + OffsetOf(udtFoo\sVal))

_________________
My Projects ThreadToGUI / OOP-BaseClass / OOP-BaseClassDispatch / EventDesigner V3
PB v3.30 / v5.70 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic 5.71 LTS is out !
PostPosted: Sat Aug 17, 2019 2:37 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 3056
Location: Boston, MA
I will discuss further in your new thread...

_________________
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic 5.71 LTS is out !
PostPosted: Sat Aug 17, 2019 4:33 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat May 05, 2007 5:31 pm
Posts: 609
Location: Linz, Austria
Thank you Fred and Team!


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic 5.71 LTS is out !
PostPosted: Tue Aug 20, 2019 6:14 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4578
Location: Spa, relaxing and thinking, and learning...
Congratulations and many thanks! :!:

_________________
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic 5.71 LTS is out !
PostPosted: Tue Aug 27, 2019 1:49 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Oct 06, 2006 4:41 am
Posts: 673
Location: Canada
Thank you, Fred and other PB tinkerers.

@Fred : it appears you forgot to include the promised constant to indicate whether the DPi option is checked in the Windows version. (see here)

_________________
"That's not a bug..." said the programmer. "...It's a feature! "
"Oh! I see..." replied the blind man.


Last edited by Blue on Thu Aug 29, 2019 3:31 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic 5.71 LTS is out !
PostPosted: Thu Aug 29, 2019 12:29 am 
Offline
Addict
Addict
User avatar

Joined: Wed Mar 24, 2004 11:04 pm
Posts: 902
Location: Seattle, USA
Fred wrote:
Final version is out, thank you a lot for testing !


Does the News page need to be updated with this version? https://www.purebasic.com/news.php
:)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 82 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye