Hi,

It's been years since I looked at that code. But the call is correct.
vmopen constructs and returns a region of type Vmalloc_t. The two main
arguments for vmopen() are a discipline Vmdisc_t to define how raw memory
is obtained for the region (sbrk, mmap, recursively from another region or
the Vmheap, etc.) and a method Vmethod_t to define the allocation
algorithm. In this case, Vmlast means that the call vmfree() will not do
anything except for the last allocated object.

Hope that helps.

Phong

On Sat, Apr 8, 2017 at 4:29 PM, David A.D. Morano, PE, PhD <
[email protected]> wrote:

> Hello All,
>
> I came across something that looks fishy in the source code for
> |librecsort| in the AST sources -- on GitHub -- here:
>
> https://github.com/att/ast/blob/c506cb548d9b4bcebef92c86e94865
> 7728760e15/src/lib/librecsort/rsmerge.c#L405
>
> This is the source file 'src/lib/librecsort/rsmerge.c' at line 405.
>
> The part of the line:
>
>         vmopen(&vmdisc,Vmlast,0)
>
> looks like a bug to me, but I do not really know what I am looking at
> any longer so if someone could confirm (or refute) that this is a bug, I
> would appreciate it.
>
> The variable 'vmdisc' is itself a pointer to a Vmdisc_t object, but the
> subroutine |vmopen| is supposed to take a pointer to a Vmalloc_t object
> (if I remember correctly). So passing '&vmdisc' (address of pointer) to
> |vmopen| looks very fishy (bad).
>
> Is this a bug? And, if so what is the fix?  I do not remember a
> patch on this already, but I could have missed it.
>
> Thanks for any help or information on this.
>
> ----
> David A.D. Morano
> [email protected]
>
> _______________________________________________
> ast-users mailing list
> [email protected]
> http://lists.research.att.com/mailman/listinfo/ast-users
>
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users

Reply via email to