|
Post by bencooper on Oct 11, 2020 14:57:46 GMT -5
In Liberty Basic how would I implement Dynamic Memory allocation ? Here I mean to manage array sizes dynamically to handle actual data requirements so to save storage space? Are there any in-built function calls to clear arrays and resize arrays as in C++ ?
|
|
|
Post by tsh73 on Oct 11, 2020 15:52:41 GMT -5
redim
Are you really hit a memory limit with LB?
EDIT I tried to allocate single huge array I made 1e8 -could redim it to 1 and then back 2e8 allocates but cannot be allocated second time 3e8 dowes not allocate at all So limit is somewhere here.
But if I made 1e7 array
t0=time$("ms") for i = 1 to n s=s+a(i) next t1=time$("ms") print "array op loop ";t1-t0
says it took 3 minutes. My machine is old, but I still think it's very long - I expect for 1e8 not less then 30 minutes, just to single pass through array.
Probably big data needs faster language.
|
|
|
Post by BeeTrap on Oct 11, 2020 15:54:21 GMT -5
linkI have not used this and just looked at it myself. May help, hope so.
|
|
|
Post by Rod on Oct 12, 2020 1:57:59 GMT -5
It would help to know what size of array or data we are talking about. Dim and Redim manage arrays and the space is recovered automatically by garbage collection.
|
|
|
Post by Brandon Parker on Oct 24, 2020 20:59:30 GMT -5
In Liberty Basic how would I implement Dynamic Memory allocation ? Here I mean to manage array sizes dynamically to handle actual data requirements so to save storage space? Are there any in-built function calls to clear arrays and resize arrays as in C++ ? bencooper, Feel free to head over to the link shown by beetrap. You will find a link to my forum (also linked below) where you will find the Dynamic Array library as well as my Import Architect tool. Start a conversation if you wish, and I can get you headed in the correct direction with one/both. lbimportarchitect.proboards.com/{:0) Brandon Parker
|
|