The Delphi 8 compiler introduces the UNSAFECODE directive.

Type SWITCH
Syntax {$UNSAFECODE ON} or {$UNSAFECODE OFF}
Default {$UNSAFECODE OFF}
Scope Local

Remarks

The  $UNSAFECODE directive controls the usage of pointers and operations involving pointers in code.

In the {$UNSAFECODE OFF} state, code that refers to pointers is not allowed. This is the default.

In the {$UNSAFECODE ON} state, code that refers to pointers needs to have its procedure/function declaration decorated with the unsafe directive. In addition, in a comment about this feature, Danny Thorpe, Borland Chief Scientist, said that “This language feature makes it very easy to incrementally add application features implemented in managed .NET code to an existing unmanaged Win32 application (without the hassles of COM registration), instead of being forced to port the entire application to managed code in an all-or-nothing gambit.  This also further differentiates Delphi from C#”. So, you can use this language feature to port your application step-by-step.

Part 2 of this article will discuss how you can use this language feature to bridge your Win32 applications to the .NET world.

Portability issue: Code marked unsafe is not portable to 64 bit .NET.

I believe the unmanaged export feature was implemented by the author of LHarc.