Re: [Freedos-devel] Larger buffers in Watcom

2018-09-19 Thread Mateusz Viste
On Wed, 19 Sep 2018 10:44:14 +0200, stecdose wrote: > HOW does a 16bit truncate limit to 16384bytes? > >      b1 b0  (byte 1, byte 0) >    b2 | |   (byte 2) >     | | | > decimal 81920 = hex 014000 decimal 65536 = hex   size of size_t = 2 > b

Re: [Freedos-devel] Larger buffers in Watcom

2018-09-19 Thread stecdose
I recently stumbled across this problem with Borland C (Affects all borland 16bit C compilers, TC, BCPP). The problem of a 2byte size_t farcalloc was the solution to allocate a 256k buffer in my case. But a part of your text gives me a question On 07/29/2018 05:17 AM, TK Chia wrote: A

Re: [Freedos-devel] Larger buffers in Watcom

2018-07-29 Thread Eric Auer
Hi! > while he didn't specify a warning level, WCL doesn't even warn with > -W=9 :-< (watcom 1.9) Wow... >> In such case the halloc() & hfree() pair does seem to be the only way. And those are deliberately kept separate from normal memory allocation calls because of the bad access performanc

Re: [Freedos-devel] Larger buffers in Watcom

2018-07-29 Thread Tom Ehlert
sorry; code example below <>. > On Sun, 29 Jul 2018 11:17:08 +0800, TK Chia wrote: >> I double-checked the compiler output (using `wdis test.o') for the >> malloc( ) call under the huge model, and found that it actually clips >> the size to a `size_t', and `size_t' is a 16-bit integer type even f

Re: [Freedos-devel] Larger buffers in Watcom

2018-07-29 Thread Tom Ehlert
> On Sun, 29 Jul 2018 11:17:08 +0800, TK Chia wrote: >> I double-checked the compiler output (using `wdis test.o') for the >> malloc( ) call under the huge model, and found that it actually clips >> the size to a `size_t', and `size_t' is a 16-bit integer type even for >> the huge model. I.e. ma

Re: [Freedos-devel] Larger buffers in Watcom

2018-07-29 Thread Mateusz Viste
On Sun, 29 Jul 2018 11:17:08 +0800, TK Chia wrote: > I double-checked the compiler output (using `wdis test.o') for the > malloc( ) call under the huge model, and found that it actually clips > the size to a `size_t', and `size_t' is a 16-bit integer type even for > the huge model. I.e. malloc(819

Re: [Freedos-devel] Larger buffers in Watcom

2018-07-28 Thread TK Chia
Hello Mr. McMackins, hello Mr. Viste, I found the bad code. While your example works, if I change it to use calloc (which is what my code is using at the particular failure point), then it fails. Looks like calloc is doing something funny. Actually, I just found that both malloc( ) and calloc(

Re: [Freedos-devel] Larger buffers in Watcom

2018-07-28 Thread David McMackins
I found the bad code. While your example works, if I change it to use calloc (which is what my code is using at the particular failure point), then it fails. Looks like calloc is doing something funny. Happy Hacking, David E. McMackins II Supporting Member, Electronic Frontier Foundation (#22969

Re: [Freedos-devel] Larger buffers in Watcom

2018-07-28 Thread Mateusz Viste
On Sat, 28 Jul 2018 11:49:42 -0500, David McMackins wrote: > Is there a way to allocate a buffer in OpenWatcom that is larger than > 64k? Sure. Either use XMS/EMS, or rely on the "huge model" kludge. > I'm currently trying to stay within the compact memory model, but > even if I compile for huge

Re: [Freedos-devel] Larger buffers in Watcom

2018-07-28 Thread TK Chia
Hello Mr. McMackins, Is there a way to allocate a buffer in OpenWatcom that is larger than 64k? I'm currently trying to stay within the compact memory model, but even if I compile for huge memory model, I'm getting an out of memory error for trying to allocate about 80k for a buffer. My machine

[Freedos-devel] Larger buffers in Watcom

2018-07-28 Thread David McMackins
Is there a way to allocate a buffer in OpenWatcom that is larger than 64k? I'm currently trying to stay within the compact memory model, but even if I compile for huge memory model, I'm getting an out of memory error for trying to allocate about 80k for a buffer. My machine has 128M of memory, so I