Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please enable UMB for internal allocs #128

Open
stsp opened this issue Dec 24, 2022 · 0 comments
Open

please enable UMB for internal allocs #128

stsp opened this issue Dec 24, 2022 · 0 comments

Comments

@stsp
Copy link

stsp commented Dec 24, 2022

Hi.

I built the prog with ia16-gcc in -mdosx mode.
I have plenty of UMBs, precisely ~160K, which
is much more than the program size.
But unfortunately, even if loaded with lh,
the prog eats quite a lot of conv mem:

ADDR(LOW) PARAS  OWNER
009c:0000 0x0200 [COMMAND - Data]
029d:0000 0x0121 [COMMAND - Data]
03bf:0000 0x00e6 [COMMAND - Data]
04a6:0000 0x0017 [FREE]
04be:0000 0x0d6a [FREE]
1229:0000 0x8dd5 [FREE] (END)

Would it be possible to enable UMBs
when allocating? I use this to enable
UMB:

static void link_umb(int on)
{
    asm volatile("int $0x21\n"
        :
        : "a"(0x5803), "b"(on)
        : "cc");
    if (on) {
        asm volatile("int $0x21\n"
            :
            : "a"(0x5801), "b"(0x80)
            : "cc");
    }
}

And then I can do:

    link_umb(1);
    db = _DPMIAllocateDOSMemoryBlock(size);
    link_umb(0);

... and that goes to UMB.
But there are some allocs during startup
that are not done with UMB enabled.
Can this be fixed?

Also I wonder if I can free the startup and
cw32 code by hands before executing another
prog. Is that possible? I'll use asm for an exec,
so I can free most of everything. Is that possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants