Re: [fpc-pascal] Open array in object constructor gives error

2023-01-04 Thread Sven Barth via fpc-pascal
Hairy Pixels  schrieb am Mi., 4. Jan. 2023, 14:45:

>
>
> > On Jan 4, 2023, at 8:23 PM, Sven Barth 
> wrote:
> >
> > You said in the other mail "there's a global stack", so just return
> memory from that stack.
>
> Well the stack is just a list that holds pointers to the classes now but I
> guess you can modify that so it turns a pointer to an address in a block of
> memory? I’ve not seen this kind of data type (except for an actual memory
> manager) so I would need to create it.
>

If your stack only contains a lost of pointers then it's back to the
original question from Marc: on what memory does your TMyObject.Create()
operate? Where does the memory come from you put into your stack?

Regards,
Sven

>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Open array in object constructor gives error

2023-01-04 Thread Hairy Pixels via fpc-pascal


> On Jan 4, 2023, at 8:23 PM, Sven Barth  wrote:
> 
> You said in the other mail "there's a global stack", so just return memory 
> from that stack. 

Well the stack is just a list that holds pointers to the classes now but I 
guess you can modify that so it turns a pointer to an address in a block of 
memory? I’ve not seen this kind of data type (except for an actual memory 
manager) so I would need to create it.

Regards,
Ryan Joseph

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Open array in object constructor gives error

2023-01-04 Thread Sven Barth via fpc-pascal
Hairy Pixels  schrieb am Mi., 4. Jan. 2023, 13:06:

>
>
> > On Jan 4, 2023, at 2:01 PM, Sven Barth 
> wrote:
> >
> > For something like that you are better of to use Object Pascal classes
> and override their NewInstance and FreeInstance methods.
> >
>
> What do you mean exactly? You still need to allocate some memory for them
> right so what do you gain?
>

You said in the other mail "there's a global stack", so just return memory
from that stack.

Regards,
Sven

>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Open array in object constructor gives error

2023-01-04 Thread Hairy Pixels via fpc-pascal



> On Jan 4, 2023, at 2:01 PM, Sven Barth  wrote:
> 
> For something like that you are better of to use Object Pascal classes and 
> override their NewInstance and FreeInstance methods. 
> 

What do you mean exactly? You still need to allocate some memory for them right 
so what do you gain?

Regards,
Ryan Joseph

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal