Re: [PD-dev] How to free memory of t_symbol

2024-02-22 Thread Alexandre Torres Porres
Em qui., 22 de fev. de 2024 às 11:26, Christof Ressi escreveu: > You must never attempt to free a symbol! > poor symbols, trapped forever ___ Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev

Re: [PD-dev] How to free memory of t_symbol

2024-02-22 Thread Christof Ressi
Thanks :-D BTW, Symbols in sclang work the same way. Also, they are frequently used in scripting languages. In this context, this is also referred to as "string interning", see https://en.wikipedia.org/wiki/String_interning Christof On 22.02.2024 15:38, Pierre Alexandre Tremblay wrote:

Re: [PD-dev] How to free memory of t_symbol

2024-02-22 Thread Pierre Alexandre Tremblay
This is by far the best explanation of symbols I’ve read, ever. Thanks! > On 22 Feb 2024, at 13:41, Christof Ressi wrote: > > Hi, > > Pd symbols are immutable and permanent. `gensym("foo")` looks if the symbol > "foo" already exists; if yes, it just returns it, otherwise it creates a new >

Re: [PD-dev] How to free memory of t_symbol

2024-02-22 Thread Christof Ressi
Hi, Pd symbols are immutable and permanent. `gensym("foo")` looks if the symbol "foo" already exists; if yes, it just returns it, otherwise it creates a new symbol, adds it to the global symbol table and finally returns it. You must never attempt to free a symbol! ``` t_symbol

Re: [PD-dev] How to free memory of t_symbol

2024-02-22 Thread IOhannes m zmölnig
Am 22. Februar 2024 10:19:27 MEZ schrieb Alexandros Drymonitis : >I have a data structure with a symbol and an array of symbols that store array >names defined as: > >``` >t_symbol **x_weights_arrays; >t_symbol *x_biases_array; >``` > >When I'm done with them, I want to free the memory, but

Re: [PD-dev] How to free memory of t_symbol

2024-02-22 Thread Alexandros Drymonitis
On 2/22/24 14:45, Lucas Cordiviola wrote: hi,  free(x_biases_array) doesn't seem to work i'm not to good at C but you are missing the correct path ("nameofthestruct"->"nameofthevarible"). like     free(x->x_biases_array). Yeah, that's a typo in the email, it's not in the code though.

Re: [PD-dev] How to free memory of t_symbol

2024-02-22 Thread Lucas Cordiviola
hi,  free(x_biases_array) doesn't seem to work i'm not to good at C but you are missing the correct path ("nameofthestruct"->"nameofthevarible"). like     free(x->x_biases_array). -- Mensaje telepatico asistido por maquinas. On 22/02/2024 06:19, Alexandros Drymonitis wrote: I have a

[PD-dev] How to free memory of t_symbol

2024-02-22 Thread Alexandros Drymonitis
I have a data structure with a symbol and an array of symbols that store array names defined as: ``` t_symbol **x_weights_arrays; t_symbol *x_biases_array; ``` When I'm done with them, I want to free the memory, but calling free(x_biases_array) doesn't seem to work, and once called, as soon