<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">2016-12-12 23:14 GMT+01:00 Maciej Izak <span dir="ltr"><<a href="mailto:hnb.code@gmail.com" target="_blank">hnb.code@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> With second iteration we could add your modifications, I have no other objections.</blockquote></div><br>New day new ideas :)</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div>With my patch we don't really need ManagedFieldCount, ManagedFields, ManagedFieldTable in TTypeData (each of Managed* can still be added later). It means also much better memory usage and it solves RTL problems (which was mentioned in my previous message). All what we need is:<br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">=== code begin ===</span></div><div><span class="gmail-im" style="font-size:12.8px">type</span></div><div><span class="gmail-im" style="font-size:12.8px"> TInitManagedField = record</span></div><div><span class="gmail-im" style="font-size:12.8px"><div> TypeRefRef: TypeInfoPtr;</div><div> FldOffset: SizeInt; </div><div> end;</div></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"> PPRecInitTable = ^PRecInitTable;</span><br></div><div><div class="gmail_extra" style="font-size:12.8px"> PRecInitTable = TRecInitTable;</div><div class="gmail_extra" style="font-size:12.8px"> TRecInitTable = packed record </div><div class="gmail_extra" style="font-size:12.8px"> Size: Longint;</div><div class="gmail_extra" style="font-size:12.8px"> Terminator: Pointer;</div><div class="gmail_extra" style="font-size:12.8px"> ManagedFieldCount: Longint;</div><div class="gmail_extra" style="font-size:12.8px"> { ManagedFields: array[0..ManagedFieldCount - 1] of <span style="font-size:12.8px">TInitManagedField </span>; }</div><div class="gmail_extra" style="font-size:12.8px"> end;</div><br style="font-size:12.8px"><div><span style="font-size:12.8px"> TRecordField = record</span><br style="font-size:12.8px"><span style="font-size:12.8px"> Visibility: TVisibility;</span><br style="font-size:12.8px"><span style="font-size:12.8px"> TypeRef: </span><span style="font-size:12.8px">TypeInfoPtr</span><span style="font-size:12.8px">;</span><br style="font-size:12.8px"><span style="font-size:12.8px"> FldOffset: </span><span style="font-size:12.8px">SizeInt</span><span style="font-size:12.8px">;</span><br style="font-size:12.8px"><span style="font-size:12.8px"> Name: PShortString; { can be NULL if no ext RTTI }</span><br style="font-size:12.8px"><span style="font-size:12.8px"> end;</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px"> TManagedField = TRecordField deprecated;</span></div><span style="font-size:12.8px"><div><span style="font-size:12.8px"><br></span></div> TTypeData = record</span><br style="font-size:12.8px"><span style="font-size:12.8px"> // ...</span><br style="font-size:12.8px"><span style="font-size:12.8px"> tkRecord: (</span><br style="font-size:12.8px"><span style="font-size:12.8px"> RecSize: Integer</span><span style="font-size:12.8px">;</span></div><div><span style="font-size:12.8px"> RecInitTable: </span><span style="font-size:12.8px">PPRecInitTable;</span></div><div><span style="font-size:12.8px"> case Boolean of</span><br style="font-size:12.8px"><span style="font-size:12.8px"> True: (ManagedFldCount: Integer deprecated 'Use </span><span style="font-size:12.8px">RecInitTable^^.</span><span style="font-size:12.8px">ManagedFieldCount or TotalFieldCount depending on your use case')</span></div><div><span style="font-size:12.8px"> False: (TotalFieldCount: Integer)</span><br style="font-size:12.8px"><span style="font-size:12.8px"> { Fields: array[1..TotalFieldCount] of TRecordField }</span><br style="font-size:12.8px"><span style="font-size:12.8px"> { Names: array[1..TotalFieldCount] of {packed} ShortString }</span><br style="font-size:12.8px"><span style="font-size:12.8px"> );</span><br style="font-size:12.8px"><span style="font-size:12.8px"> end;</span><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">=== code end ===</span></div><div><br></div><div>I have hope that this is final solution :)<br></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Best regards,<br>Maciej Izak</div></div></div>
</div></div>