Here is the full implementation of aligned arrays, let me know if it works
for you.
https://www.getlazarus.org/arrays/
Here is another example:
uses
AlignArrays;
procedure Test;
var
VertexData: TAlignedArray;
V: PVec3;
I: Integer;
begin
VertexData.Length := 100; // page sized and alig
Just to add a minor thing... while usually you don't have to align memory
any more coarsely than 16 bytes for XMM, 32 bytes for YMM and 64 bytes for
ZMM, the 4 kB granularity is useful for paging, especially if you're
reading or writing to a swap file. An entire library of functions for
such memo
Here is a brief follow up. I am working on other projects at the moment,
but I am confident this a simple solution. Please tell me if this somehow
will not fit you needs.
Create a new type that is compatible with Array where Array = type
array of T.
Define implcit conversions between the to types
Am 28.03.2019 um 15:17 schrieb Ryan Joseph:
Also I don't think that a simple "do alignment or not" will be sufficient. What
kind of alignment do you pick? What if the user needs more alignment? So it would
probably be best to add a new SetLengthAligned of which the second argument is the
ali
Am 28.03.2019 um 18:41 schrieb Ryan Joseph:
Now I’m using “cd /rtl; make all FPC=/path/to/compiler” to build the RTL but
this is obviously slow and unnecessary. Is there a quicker way to build just
the unit which contains dynarr.inc and have all the objects files to be put in
the correct locat
Op 2019-03-28 om 15:31 schreef Karoly Balogh (Charlie/SGR):
(Unless it also has to compile with say, Delphi.)
Everybody has {$pointermath on} is the include file included in every
unit nowadays. Or at least I hope :-)
___
fpc-devel maillist - fpc-d
Ryan, this is just a thought. Do you need the flat memory address to start
on an even 4 KB boundary or are you okay with the memory address starting
at any DWORD address and spanning an even 4 KB after that address?
In the latter case I have an easy solution for you. If the former I am
unsure how
On Thu, 28 Mar 2019, 20:34 Ryan Joseph, wrote:
> Now I’m using “cd /rtl; make all FPC=/path/to/compiler” to build the RTL
> but this is obviously slow and unnecessary. Is there a quicker way to build
> just the unit which contains dynarr.inc and have all the objects files to
> be put in the corre
Now I’m using “cd /rtl; make all FPC=/path/to/compiler” to build the RTL but
this is obviously slow and unnecessary. Is there a quicker way to build just
the unit which contains dynarr.inc and have all the objects files to be put in
the correct location?
Regards,
Ryan Joseph
_
Heh, much better - thank you!
On Thu 28/03/19 14:31 , "Karoly Balogh (Charlie/SGR)"
char...@scenergy.dfmk.hu sent:
Hi,
On Thu, 28 Mar 2019, J. Gareth Moreton wrote:
> I think the official unsigned 32-bit integer type in Pascal is
> "LongWord". As others have said, be aware that pointers
Hi,
On Thu, 28 Mar 2019, J. Gareth Moreton wrote:
> I think the official unsigned 32-bit integer type in Pascal is
> "LongWord". As others have said, be aware that pointers are 64-bit under
> x64... that's kind of why it's called x64! If you absolutely must have
> a packed record with 32-bit typ
> On Mar 28, 2019, at 4:17 AM, Sven Barth via fpc-devel
> wrote:
>
> The order should be
>
> [padding] [header] [data]
>
> with the offset being part of the header. This way you reduce the changes
> needed to only those that allocate/free an array.
Yeah that’s probably the better idea bec
Ryan Joseph schrieb am Do., 28. März 2019,
03:01:
> Here’s the basic structure:
>
> [header][padding][offset][head]
>
> [head] being the start of the elements (the pointer to the first element
> of the array) and aligned to the requested amount. Keep in mind the head is
> the pointer which is pas
13 matches
Mail list logo