Hi there,
I was wondering the following: Would it be an example of bad programming to do the following:
Execute GLOBALMEM ALLOC and GLOBALMEM LOCK in, say, a constructor of an object and keep the memory block "locked" for the lifetime of the object. And only do the corresponding GLOBALMEM UNLOCK (and GLOBALMEM FREE of course) when destroying the object?
I am guessing this is not the way we should work, but I was wondering why? C programmers, for instance, using malloc would only allocate memory and deallocate it, wouldn't they?
By the way, I always wanted GLOBALMEM-like features for PB but always thought we would not get them, because I thought they would think it would be too C-like... and so did never send my request in. This is probably the proof however that everybody SHOULD always send in their PB wishlists in to the PowerBASIC Inc. folks.
Best regards, Vincent
I was wondering the following: Would it be an example of bad programming to do the following:
Execute GLOBALMEM ALLOC and GLOBALMEM LOCK in, say, a constructor of an object and keep the memory block "locked" for the lifetime of the object. And only do the corresponding GLOBALMEM UNLOCK (and GLOBALMEM FREE of course) when destroying the object?
I am guessing this is not the way we should work, but I was wondering why? C programmers, for instance, using malloc would only allocate memory and deallocate it, wouldn't they?
By the way, I always wanted GLOBALMEM-like features for PB but always thought we would not get them, because I thought they would think it would be too C-like... and so did never send my request in. This is probably the proof however that everybody SHOULD always send in their PB wishlists in to the PowerBASIC Inc. folks.
Best regards, Vincent
Comment