Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #5478

Re: Orca/C malloc

From Stephen Heumann <stephen.heumann@gmail.com>
Newsgroups comp.sys.apple2.programmer
Subject Re: Orca/C malloc
Date 2020-04-05 20:56 -0500
Organization A noiseless patient Spider
Message-ID <r6e299$8da$1@dont-email.me> (permalink)
References <52f15c85-446d-4e31-af9b-a31fb050c756@googlegroups.com>

Show all headers | View raw


On 2020-04-05 20:28:03 +0000, Chris Vavruska said:

> I know that malloc is implemented in orca/c by having the memory 
> manager alloc a large block and divide it up based on malloc 
> allocations. When I use malloc in an application it works just fine, 
> but if I take the same code an try to run it in an NDA/CDEV it runs 
> into issues, ie hangs and crashes. Is there a reason for this? Is the C 
> memory manager not initialized for a NDA/CDEV? Could the memory be 
> moved around so the pointers are no longer valid? I have worked around 
> this by using NewHandle and dereferencing the handle to get the pointer.

AFAIK, malloc should work in an NDA or CDEV written with ORCA/C, and 
I'm not aware of a bug that would cause the problems you are seeing.

The ORCA libraries, including the memory management code, do require 
initialization.  If the NDA/CDEV is written in ORCA/C using the 
corresponding pragma, then the generated .root file should contain 
calls to do the necessary initialization.  If not (e.g. if you are 
calling C subroutines from a main program written in assembly), then 
you may need to manually initialize things.  There is some 
documentation about this in the ORCA/M release notes (Asm65816.notes).

-- 
Stephen Heumann

Back to comp.sys.apple2.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Orca/C malloc Chris Vavruska <vavruska@gmail.com> - 2020-04-05 13:28 -0700
  Re: Orca/C malloc Stephen Heumann <stephen.heumann@gmail.com> - 2020-04-05 20:56 -0500
    Re: Orca/C malloc Chris Vavruska <vavruska@gmail.com> - 2020-04-05 20:05 -0700
      Re: Orca/C malloc Stephen Heumann <stephen.heumann@gmail.com> - 2020-04-05 22:55 -0500
        Re: Orca/C malloc Chris Vavruska <vavruska@gmail.com> - 2020-04-06 16:14 -0700
          Re: Orca/C malloc Chris Vavruska <vavruska@gmail.com> - 2020-04-06 16:35 -0700
            Re: Orca/C malloc Stephen Heumann <stephen.heumann@gmail.com> - 2020-04-06 21:59 -0500
              Re: Orca/C malloc Chris Vavruska <vavruska@gmail.com> - 2020-04-08 16:38 -0700

csiph-web