[fpc-pascal] Fwd: What to do to get new users
Sven Barth
pascaldragon at googlemail.com
Sat Oct 19 16:09:17 CEST 2024
Hairy Pixels via fpc-pascal <fpc-pascal at lists.freepascal.org> schrieb am
Sa., 19. Okt. 2024, 15:14:
> On Oct 19, 2024 at 8:10:02 PM, Sven Barth via fpc-pascal <
> fpc-pascal at lists.freepascal.org> wrote:
>
>> For a class one can override NewInstance and FreeInstance. And with
>> TVirtualMethodInterceptor (I think not yet implemented in FPC) it might
>> even be possible to replace these on an existing class type without
>> inheriting from it. I have not tested that yet, but it *might* work.
>>
>
> This isn’t good enough though. The idea is you have multiple allocators
> for different life times in your program and allocate each class from one
> of those. A type based allocator is global for all classes and while you
> can push/pop allocators in scopes this isn’t thread safe.
>
You didn't understand what I wrote. Assuming what I thought up works, it
would be possible to replace NewInstance and FreeInstance *per instance* as
desired.
Regards,
Sven
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20241019/a2bfccd3/attachment.htm>
More information about the fpc-pascal
mailing list