[fpc-devel] Aligned dynamic arrays

J. Gareth Moreton gareth at moreton-family.com
Sat Mar 30 18:11:02 CET 2019


 I always get nervous of mode switches because it's hard to remember them
or realise they exist, and it feels a little hacky, like it's a kind of
compatibility setting more than anything else.  Like at one point, I
preferred there was an explicit way to set a type's alignment so there's no
ambiguity or risk of bugs if a different setting is used or otherwise
overridden.  e.g.

 type  TVector4f = packed record
     x, y, z, w: Single;
   end align 16;

 Just my thought.

 Kit

 On Sat 30/03/19 17:31 , Mattias Gaertner via fpc-devel
fpc-devel at lists.freepascal.org sent:
 On Sat, 30 Mar 2019 12:57:48 -0400 
 Ryan Joseph  wrote: 

 > > On Mar 30, 2019, at 12:53 PM, Mattias Gaertner via fpc-devel 
 > >  wrote: 
 > > 
 > > I guess you mean auto dereferencing. 
 > > {$ModeSwitch AutoDeref} 
 > 
 > Yeah I just found this by looking around in the compiler. Mind. 
 > Blown. No idea that existed! 

 And some people still ask for more modeswitches... 

 Mattias 
 _______________________________________________ 
 fpc-devel maillist - fpc-devel at lists.freepascal.org [3] 
 http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
[4]">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel 

 

Links:
------
[1] mailto:ryan at thealchemistguild.com
[2] mailto:fpc-devel at lists.freepascal.org
[3] mailto:fpc-devel at lists.freepascal.org
[4] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190330/e0d89c3a/attachment.html>


More information about the fpc-devel mailing list