• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Allocate and Free memory

New Here ,
Feb 03, 2006 Feb 03, 2006

Copy link to clipboard

Copied

Hello forum:

I have used allocate and free C functions to obtain and delete data. It works ok, but when i move my plugin (filter) to another PC it crash. Is it this the right way to use memory in photoshop plugins? If not, could you give me an example of allocating and deallocating a double array for instance??

Thanks in advance
TOPICS
SDK

Views

355

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Participant ,
Mar 05, 2006 Mar 05, 2006

Copy link to clipboard

Copied

What development environment are you using?

On Windows, building plugins with VS6 and VS2005, I recently found that crashes could be caused by using malloc() to allocate data that is supposed to persist between plugin calls (such as the pb->parameters block). Changing to the pb->handleProcs calls fixed this issue. Using malloc()/free() within a single plugin entry does not appear to be a problem.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 16, 2006 Mar 16, 2006

Copy link to clipboard

Copied

Im using VS6,
By the way, would you mind to give an example of use using handleProcs calls? As you can see, im starting with plugin programming
Thanks in advance

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mar 21, 2006 Mar 21, 2006

Copy link to clipboard

Copied

LATEST
The SDK documents how you should and should not allocate memory.
You really need to use the Photoshop provided allocation routines to avoid running out of address space (and let Photoshop free some memory or address space as needed).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines