Skip to main content

Hello,

i'm trying to write a C dll that called in a Cobol program returns data in a memory section allocated with C malloc().

The problem is when i'm trying to free that memory in Cobol with a m$free it seems doesn't work.

My question is: m$free work only with memory allocated with m$alloc?

There is a way to free in Cobol a memory section allocated with C malloc()?

There is a way to allocate in C a memory section using the Cobol m$alloc?


#c
#DLL
#C
#mfree
#malloc
#AcuCobol

Hello,

i'm trying to write a C dll that called in a Cobol program returns data in a memory section allocated with C malloc().

The problem is when i'm trying to free that memory in Cobol with a m$free it seems doesn't work.

My question is: m$free work only with memory allocated with m$alloc?

There is a way to free in Cobol a memory section allocated with C malloc()?

There is a way to allocate in C a memory section using the Cobol m$alloc?


#c
#DLL
#C
#mfree
#malloc
#AcuCobol
m$malloc and m$free aren't direct interfaces to the system malloc() and free() routines so you can't mix and match them. You should be able to add your own call to free() using the sub or sub85 interfaces. See lib/sub.c and lib/sub85.c.

Hello,

i'm trying to write a C dll that called in a Cobol program returns data in a memory section allocated with C malloc().

The problem is when i'm trying to free that memory in Cobol with a m$free it seems doesn't work.

My question is: m$free work only with memory allocated with m$alloc?

There is a way to free in Cobol a memory section allocated with C malloc()?

There is a way to allocate in C a memory section using the Cobol m$alloc?


#c
#DLL
#C
#mfree
#malloc
#AcuCobol

Hi.

We are looking for a way to allocate "cobol memory" from C.  This should allow us to free that memory simply using m$free.

We got the "rtcallbk.h" header file, the structure RUNTIME_CALLS_TABLE and its function pAmalloc.

It seems to be what we are lookin for but .... we cannot find the library that define that structure so we get a linking error: 

                     LNK1120 1 unresolved externals

 

Someone can help us ?

Thank you


Hello,

i'm trying to write a C dll that called in a Cobol program returns data in a memory section allocated with C malloc().

The problem is when i'm trying to free that memory in Cobol with a m$free it seems doesn't work.

My question is: m$free work only with memory allocated with m$alloc?

There is a way to free in Cobol a memory section allocated with C malloc()?

There is a way to allocate in C a memory section using the Cobol m$alloc?


#c
#DLL
#C
#mfree
#malloc
#AcuCobol

Hi.

We are looking for a way to allocate "cobol memory" from C.  This should allow us to free that memory simply using m$free.

We got the "rtcallbk.h" header file, the structure RUNTIME_CALLS_TABLE and its function pAmalloc.

It seems to be what we are lookin for but .... we cannot find the library that define that structure so we get a linking error: 

                     LNK1120 1 unresolved externals

 

Someone can help us ?

Thank you


Hello,

i'm trying to write a C dll that called in a Cobol program returns data in a memory section allocated with C malloc().

The problem is when i'm trying to free that memory in Cobol with a m$free it seems doesn't work.

My question is: m$free work only with memory allocated with m$alloc?

There is a way to free in Cobol a memory section allocated with C malloc()?

There is a way to allocate in C a memory section using the Cobol m$alloc?


#c
#DLL
#C
#mfree
#malloc
#AcuCobol
If you have access to the DLL, the quickest and easiest way would (probably) be to simply write your own method to clear it within the C shell. You created it there, why not clear it from there as well?

Hello,

i'm trying to write a C dll that called in a Cobol program returns data in a memory section allocated with C malloc().

The problem is when i'm trying to free that memory in Cobol with a m$free it seems doesn't work.

My question is: m$free work only with memory allocated with m$alloc?

There is a way to free in Cobol a memory section allocated with C malloc()?

There is a way to allocate in C a memory section using the Cobol m$alloc?


#c
#DLL
#C
#mfree
#malloc
#AcuCobol
Because we want to create our standard structure in C in an allocated memory and free that memory in Cobol without worrying about who has allocated this memory.

Paolo