Wiki improvements

Forum for discussion about the documentation project.
Post Reply
badidea
Posts: 2628
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Wiki improvements

Post by badidea »

@fxm:
Is this statement on https://www.freebasic.net/wiki/TutIntroArrays correct?
"Static arrays, the arrays described above, are kept on the heap, but dynamic arrays are allocated from the computer's pool of memory. The compiler dynamically allocates memory for the array based on the requested dimensions of the array."

I thought incorrect, but I may have misunderstood the 'heap'.
fxm
Moderator
Posts: 12465
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Wiki improvements

Post by fxm »

In the context of this sentence, I think that 'static arrays' means 'fixed-length arrays' and therefore that this beginning of the sentence is wrong.
I simply propose to delete the beginning of the sentence:
Dynamic arrays are allocated from the computer's pool of memory. The compiler dynamically allocates memory for the array based on the requested dimensions of the array.
or correct it:
Static (fixed-length) arrays, the arrays described above, are kept either in static storage or on the program stack, but dynamic arrays are allocated from the computer's pool of memory. The compiler dynamically allocates memory for the array based on the requested dimensions of the array.
Last edited by fxm on Jan 24, 2025 6:08, edited 1 time in total.
Reason: Complemented post.
badidea
Posts: 2628
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Wiki improvements

Post by badidea »

The first (with less information) seems better to me.
In both suggestions the reference to heap is gone, but in the second 'static storage or program stack' is now mentioned which is confusing if we don't explain the difference between these 2 concepts.
Maybe add a link to https://www.freebasic.net/wiki/ProPgDynamicMemory where this is better explained?
fxm
Moderator
Posts: 12465
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Wiki improvements

Post by fxm »

Retained sentence:
Dynamic arrays are allocated from the computer's pool of memory called heap. The compiler dynamically allocates memory for the array based on the requested dimensions of the array.

Documentation updated:
TutIntroArrays → fxm [rewording]
Post Reply