Memory management for non REALObjects

Hello everybody,

I’m currently a little bit confused about the memory management, done by the REALbasic/Xojo when creating PlugIns.
My problem is connected to a linked list, like

typedef struct T { T* next; int some_val; } T;

I’ve encountered that it is needed to Lock Objects, which are related to the Xojo-structure (Like strings and Objects) to prevent Xojo from deleting them. (Is it actual some kind of garbage collector?)
But, does this also hold for the heap, managed by the shared object, created by the compiler?
My problem is, when creating new elemets for this linked list (with malloc), Xojo encounters an error and exits with non-helpful error-messages.

There would also be my second question - is it possible to turn on something like Debug-messages in Xojo or the Plugin-SDK or have I to handle this by myself?

Thank you very much in advance,

GD

Normally the head of the linked list would be stored in class data for the object representing the head in Xojo.
Than in that object’s destructor you would free the list.

Debug messages are your own business. e.g. NSLog on Mac and OutputDebugString on Windows which you may want to bundle into your own log function.

PS: Maybe we arrange a private plugin development training for you?

Simple reference counting.

No. The heap and all other resources are unmanaged.

Thank you!

By the way and reffering to the PS: Are there additional ressources for the SDK? The information from the PluginSDK are a little bit short and the romaing in the plugins’ header produces sometimes ambigouos results - at least with my knowledge. And this trial and error is somehow truncated by the need to be productive during my working hours :wink:

[quote=314090:@G. Deppendorf]Thank you!

By the way and reffering to the PS: Are there additional ressources for the SDK? The information from the PluginSDK are a little bit short and the romaing in the plugins’ header produces sometimes ambigouos results - at least with my knowledge. And this trial and error is somehow truncated by the need to be productive during my working hours ;)[/quote]

see my reply on https://forum.xojo.com/38306-plugins-and-standard-c-first-steps