Garbage Collection with variables from plugins?

Only to be sure, does breve's garbage collection also handle variables which get allocated on heap from a plugin but only used in breve?

for example, a plugin function (I did not use breve datatypes, though I would have to..):

int* foo()
{
  int* x;
  x = (int*) malloc(sizeof(int)*anysize);
  return x;
}

now the use within breve ..

+to useFoo:
    x(int).
    x = callFooProxy().

at the end of the method useFoo in breve is the memory allocated by the plugin's function foo() freed?

Garbage Collection with variables from plugins?

Nope, handling that is your responsibility. breve's garbage collection works for objects, list and hashes in the steve-level code, but not for things in the C-level code.

- jon

Garbage Collection with variables from plugins?

Just to be sure that I understand you right. If I set the "brEval *resultpointer" to, say, a brInt type which is returned to breve, I have to clean this variable on my own.
But what does breve actually get, is the brInt-variable copied, so that I can deallocated this variable immediately or do I have to keep it as long as breve uses it within the steve language (because steve references the variable directly) ?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.