juliafree-variable

Destroy type in Julia


I have to destroy some type in Julia which looks like:

struct City
    x::Int
    y::Int
    index::Int
end

and I want a function like

  destroy(City)

that will delete this. Is it possible?

Thanks for your answers.


Solution

  • Julia is a garbage collected language – you do not need to explicitly free the memory used by objects and there is no mechanism to do so. Garbage collection happens automatically in response to memory pressure, or you can invoke it manually be calling the gc() function.