Is it safe, or good practise, to allocate memory with SYS"malloc"?
Posted: Tue 22 Jan 2019, 19:33
Hello,
I'm thinking of converting a program that I previously wrote in C, into BASIC for BBCSDL.
Without going into much detail, this program uses malloc() and free() quite a lot.
As far as I know, BBC BASIC doesn't have a built-in mechanism for freeing memory that's been allocated, for example with DIM. (If I'm wrong, please let me know.) So I was thinking I would simply use SYS to call malloc() and free() exactly as I did in my C program.
Is this safe to do? I mean, can I expect this to work without problems?
Is it good practise?
What do you all think?
Thanks everyone
- PM
I'm thinking of converting a program that I previously wrote in C, into BASIC for BBCSDL.
Without going into much detail, this program uses malloc() and free() quite a lot.
As far as I know, BBC BASIC doesn't have a built-in mechanism for freeing memory that's been allocated, for example with DIM. (If I'm wrong, please let me know.) So I was thinking I would simply use SYS to call malloc() and free() exactly as I did in my C program.
Is this safe to do? I mean, can I expect this to work without problems?
Is it good practise?
What do you all think?
Thanks everyone
- PM