August 10, 2001
Then I am back to square one.  All I have is an array of characters.  The object size of a character object is 1.  Any number is evenly divisible by 1.
So I guess I don't have to worry?

Thanks,

Mark


On Fri, 10 Aug 2001 09:38:19 -0700, "Walter" <walter@digitalmars.com> wrote:
> No, the rule is if an array of objects is allocated, then 64k must be evenly divisible by that object size. That is because offset arithmetic, as in h->offset, cannot wrap. -Walter
> 
> Mark Evans wrote in message <1103_997452984@dphillips>...
> >Walter,
> >
> >Thanks.
> >
> >Is that a fundamental Win16 issue, or just a compiler issue that could be
> improved?  It would be nice if huge pointers did not have this restriction.
> >
> >As I understand what you are saying, the only valid huge memory blocks are
> N times 64K in size (contiguous) up to the limit of 1 MB; and behavior of nonconforming huge blocks is undefined.
> >
> >Mark
> >
> >
> 
> 


August 10, 2001
Not about that particular problem, no. Are you able to identify a particular line of code where you're getting a segment wrap?

Mark Evans wrote in message <1103_997458762@dphillips>...
>
>Then I am back to square one.  All I have is an array of characters.  The
object size of a character object is 1.  Any number is evenly divisible by 1.
>So I guess I don't have to worry?
>
>Thanks,
>
>Mark
>
>
>On Fri, 10 Aug 2001 09:38:19 -0700, "Walter" <walter@digitalmars.com>
wrote:
>> No, the rule is if an array of objects is allocated, then 64k must be
evenly
>> divisible by that object size. That is because offset arithmetic, as in h->offset, cannot wrap. -Walter
>>
>> Mark Evans wrote in message <1103_997452984@dphillips>...
>> >Walter,
>> >
>> >Thanks.
>> >
>> >Is that a fundamental Win16 issue, or just a compiler issue that could
be
>> improved?  It would be nice if huge pointers did not have this
restriction.
>> >
>> >As I understand what you are saying, the only valid huge memory blocks
are
>> N times 64K in size (contiguous) up to the limit of 1 MB; and behavior of nonconforming huge blocks is undefined.
>> >
>> >Mark
>> >
>> >
>>
>>
>
>


August 10, 2001
Not really but I could look harder.

Again, any design tips about how DM treats huge pointers would be useful.

I'm not too worried about this because the bug is probably mine and pertains to some obscure, rare situation that only happens after several thousand calls have been made.  I just wanted to pulse you before starting a full-scale investigation.  Any tips about huge pointer behavior/design would help.  Already I've learned some new things about them.

As far as I know right now, my circular buffer code is perfect and works indefinitely (rolling over and over and over) when the size is < 1 segment.  The identical C code works fine for a long time when the buffer is > 1 segment but not forever.  After several thousand calls something goes wrong.  I will look into it.

Mark


On Fri, 10 Aug 2001 11:45:23 -0700, "Walter" <walter@digitalmars.com> wrote:
> Not about that particular problem, no. Are you able to identify a particular line of code where you're getting a segment wrap?
> 
> Mark Evans wrote in message <1103_997458762@dphillips>...
> >
> >Then I am back to square one.  All I have is an array of characters.  The
> object size of a character object is 1.  Any number is evenly divisible by 1.
> >So I guess I don't have to worry?
> >
> >Thanks,
> >
> >Mark
> >


August 10, 2001
Huge pointer arithmetic should work or fail, not work 999 times and fail once. It sounds like you have a program bug. Look for uninitialized variables, dangling pointers, etc. -Walter

Mark Evans wrote in message <1103_997477807@dphillips>...
>
>Not really but I could look harder.
>
>Again, any design tips about how DM treats huge pointers would be useful.
>
>I'm not too worried about this because the bug is probably mine and
pertains to some obscure, rare situation that only happens after several thousand calls have been made.  I just wanted to pulse you before
>starting a full-scale investigation.  Any tips about huge pointer
behavior/design would help.  Already I've learned some new things about them.
>
>As far as I know right now, my circular buffer code is perfect and works
indefinitely (rolling over and over and over) when the size is < 1 segment. The identical C code works fine for a long time when the
>buffer is > 1 segment but not forever.  After several thousand calls
something goes wrong.  I will look into it.
>
>Mark
>
>
>On Fri, 10 Aug 2001 11:45:23 -0700, "Walter" <walter@digitalmars.com>
wrote:
>> Not about that particular problem, no. Are you able to identify a
particular
>> line of code where you're getting a segment wrap?
>>
>> Mark Evans wrote in message <1103_997458762@dphillips>...
>> >
>> >Then I am back to square one.  All I have is an array of characters.
The
>> object size of a character object is 1.  Any number is evenly divisible
by
>> 1.
>> >So I guess I don't have to worry?
>> >
>> >Thanks,
>> >
>> >Mark
>> >
>
>


1 2
Next ›   Last »