Skip to content

Clean up associative array runtime interface to enable precise GC #18294

@dlangBugzillaToGithub

Description

@dlangBugzillaToGithub

nfxjfg reported this on 2010-08-24T01:58:57Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=4719

CC List

Description

Currently, the AA implementation (in aaA.d) has no way of knowing what the type of an AA is. All it gets is the key TypeInfo and the value type's size. This makes precise GC impossible. (Issue 3463 has a compiler patch that adds pointer bitmaps to TypeInfo. The AA implementation needs these to allocate the AA data in a way that enables precise scanning.)

This enhancement suggests to clean up the AA runtime interface, that consists of functions starting with "_aa" (e.g. _aaGet). All of these functions should carry a TypeInfo_AssociativeArray reference as parameter.

Note that would actually _reduce_ the number of parameters these runtime functions typically have, which I find funny.

There may be compatibility concerns. This is simple to solve: the compiler can just define a new version symbol to signal that a new AA ABI is used. Or if actual binary compatibility with old code is desired, the old interface could be emulated in aaA.d by still providing the old functions; the new interface would use different function names.

PS: not attempting to write a patch, because even if this enhancement gets accepted, Walter most likely would rewrite the patch himself.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions