Hello,

You can do malloc / free BUT NOT for the arrays / string you are returning to 
AmiBroker in AmiVar structure.
Why? Because malloc/free uses default process heap while AFL engine manages its 
own heaps to prevent memory fragmentation.

So you can use malloc/free everywhere except for variables that you are 
returning in AmiVar.

Best regards,
Tomasz Janeczko
amibroker.com

On 2010-07-01 23:43, tiedemj wrote:
> Hello
>
> When allocating memory for objects and data in a C++ custom (plugin) DLL, I'm 
> using AllocArrayResult and Alloc during individual "runs", and malloc/free in 
> the initialization of the plugin. However, is it possible to allocate 
> additional "static/persistent" memory during "runs" – and what is the way to 
> do it?
>
> When using malloc/free during "runs", I get "heap disruption" exceptions. 
> This could be due to errors in my code – or that malloc/free collides with 
> AmiBrokers own memory management. If this is the case, is there a way to 
> allocate static/persistent memory during "runs" (outside the initialization 
> of the plugin) using AmiBrokers memory management?
>
> Best regards
> Jens
>
>
>
>
>
> ------------------------------------
>
> **** IMPORTANT PLEASE READ ****
> This group is for the discussion between users only.
> This is *NOT* technical support channel.
>
> TO GET TECHNICAL SUPPORT send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> http://www.amibroker.com/feedback/
> (submissions sent via other channels won't be considered)
>
> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
>
> Yahoo! Groups Links
>
>
>
>


------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to