Jump to content

Cristian Peța

Members
  • Content Count

    330
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Cristian Peța

  1. Cristian Peța

    Custom Managed Records Coming in Delphi 10.3

    Compiler optimizations can bite sometimes.
  2. Cristian Peța

    Custom Managed Records Coming in Delphi 10.3

    For protection against modifying const parameters the language shouldn't have pointers. When ARC was introduced with iOS compiler there was a warning that in the future pointers can be banned by NEXTGEN compilers. But I don't think this will ever happen.
  3. I don't see any issues after I build camera_shake in 10.2.3 with IDE FixPack. Code completion and others are instant. BTW build time is the same as in 10 Seattle.
  4. Which project have you compiled in 10.2.3? I have an error in TERRA_OGG: function stb_vorbis_get_samples_short_interleaved(f:pvorb; channels:integer; buffer:array of SmallInt; num_shorts:integer):integer; var outputs: TOutput; len,n,z,k,kk,ch:integer; buf:array of SmallInt; begin len := num_shorts div channels; n:=0; kk:=0; z := f.channels; if z>channels then z:=channels; buf:=@buffer[kk]; <---[dcc32 Error] TERRA_OGG.pas(5391): E2010 Incompatible types: 'Dynamic array' and 'Pointer'
  5. First I recommend you to install Andy's IDE FixPack. It will be much better. And I tried to compile in 10 Seattle out of curiosity but: - particles_simple sample does not compile because TERRA_SpriteManager unit is missing. - linetest sample does not compile because TERRA_Scene unit is missing. - camera_shake finally compiles.... And there is soooo much noise at compilation.... a lot of hints and warnings. Someone must clean this before take this project seriously. And 167 kloc in 127 seconds for camera_shake sample (win32)? I have a project with 243 kloc that compiles in 10 seconds on the same machine. I'm not surprised that CodeInsight is so slow. PS. In 10 Seattle CodeInsight is instant after a build (FixPack installed).
  6. Cristian Peța

    Custom Managed Records Coming in Delphi 10.3

    Nice if we optionally can modify the source. For example we can mark that a copy was made or to increment a counter of copies.
  7. Cristian Peța

    Directions for ARC Memory Management

    New.Of() can also be a simple function that returns a record like: function Keep(AObject: TObject): TKeepObjectAndFreeRecord;
  8. Cristian Peța

    Directions for ARC Memory Management

    A record without a reference will stay alive up to routine end? I must test this. .... Just verified in Lazarus and suppose it's similar in Delphi. That record lives on stack up to the routine end.
  9. Cristian Peța

    Directions for ARC Memory Management

    Perhaps that New record must also be declared next to s1. Otherwise how can it go out of scope?
  10. Cristian Peța

    Directions for ARC Memory Management

    I only wanted a simple way to clear my code of that "try finally end" for local, short lived instances. They are the wast majority in my code. For other objects (the minority) I prefer manual memory management and not to fight an automatic one. IShared<T> is nice but a little convoluted.
  11. Cristian Peța

    Directions for ARC Memory Management

    It would be wrong if somewhere is an unsafe reference. But this is true also if using Shared<T> or IShared<T>. Or any other smart pointer.
  12. Cristian Peța

    Directions for ARC Memory Management

    I don't understand what would be wrong to enable ARC for objects and to consider [unsafe] as default. It will not brake old code. And using [safe] or [arc] we can have automatic memory management. At least for simple scenarios.
  13. Cristian Peța

    How to make a component available to all platforms

    I discovered this looking in FMX sources.
  14. Cristian Peța

    Directions for ARC Memory Management

    What if we would have [safe] attribute? It would be very useful for local instances. We have [unsafe] attribute but not [safe]. In ARC all instances are implicitly [safe] and we need to explicitly mark with [unsafe] if we don't want ARC. I call this implicit ARC. But with [safe] we can have explicit ARC where all instances are implicit [unsafe].
×