Forum > Beginners

[Beginner] Crash in TProcess Pipe access

<< < (2/2)

marcov:
Oh, and pass buffer[0] and errbuffer[0] to read.

Passing the dynamic variable itself might lead to problems, it might read into the pointer, not the data)

colo:

--- Quote from: marcov on May 01, 2022, 03:53:14 pm ---Oh, and pass buffer[0] and errbuffer[0] to read.

Passing the dynamic variable itself might lead to problems, it might read into the pointer, not the data)

--- End quote ---

THAT was it, apparently! Thanks so much; I will have to carefully study what those identifiers I keep throwing around with very little actualunderstading translate to on the machine level rather sooner than later :)

marcov:
Glad to be of service  ;D

MarkMLl:

--- Quote from: colo on May 01, 2022, 05:23:33 pm ---THAT was it, apparently! Thanks so much; I will have to carefully study what those identifiers I keep throwing around with very little actualunderstading translate to on the machine level rather sooner than later :)

--- End quote ---

I'd missed that, I was looking at the lifetime of aProcess etc..

Something like a dynamic array or string only has a small amount of state stored locally (i.e. on the stack etc.), so e.g. @myBuffer or @myString is the address of an opaque data structure which contains a pointer to the data itself which is on the heap. So for a dynamic array the address of the first actual element is @myBuffer[0], while for a string it would be @myString[1] since element zero is reserved for historical reasons.

MarkMLl

Navigation

[0] Message Index

[*] Previous page

Go to full version