Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Recovering Memory allocated to sub-buffers
Topic Summary: e.g. textSubString = textString[(end 0)+2:]
Created On: 27-Nov-2006 17:50
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 27-Nov-2006 17:50
User is offline View Users Profile Print this message


Shawn Stepper

Posts: 96
Joined: 6-Aug-2004

I recall at some point in the past being told how to recover memory allocated to temporary buffers, but seem to have lost my notes. This occurs in situations where you are extracting a portion of a buffer. There is an intermediary buffer created that is not freed. But there is some way to get a handle on the intermediary buffer and delete it. Does anyone know how to do this?

Here is example code that I believe triggers this situation:

textSubString = textString[(end 0)+2:]

Thanks!

-------------------------
Shawn Stepper
shawn.e.stepper@wellsfargo.com
Report this to a Moderator Report this to a Moderator
 29-Nov-2006 18:38
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

I don't understand 'temporary buffer'; all buffers are 'temporary' in the sense that the memory is free up when you delete(Buffer).

I suspect you are asking about the 'tempStringOf(Buffer)' command, which extracts a string from a buffer without putting that string in the internal 'string table', the prime cause of Memory Leak. The string retrieved with tempStringOf is actually just a pointer to that spot in the buffer. If you assign that to a variable you are effectively just making an alias of the variable to that spot in the buffer.

Use tempStringOf(Buffer) when the results are going somewhere permantly, such as to an attribute value, printed, or sent to a file.

- Louie
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 2 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.