Skip to content

kernel: replace more C string manipulation by GAP string objects #4675

Open
@fingolfin

Description

@fingolfin

Right now, the kernel still does quite a bit of mucking around with C strings, using strlcpy, strlcat, etc. -- a big part of that is for dealing with GAP roots, in src/sysroots.c. This cold could be made considerably easier (and safer) if it used GAP string and list objects for this.

However, we have a chicken-and-egg problem here: to use objects, the GAP memory manager needs to be initialized. But that requires us to have parsed command line arguments (CLAs). But the code parsing the CLAs in particular adds new sysroots...

To break this, I propose that we simply parse the CLAs twice: the first time around, we only look for options affecting the memory manager; then we set up the memory manager; and now parse the CLAs a second time, this time ignoring the complement of what was ignored before, i.e., only those for the memory manager.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: enhancementLabel for issues suggesting enhancements; and for pull requests implementing enhancementstopic: kernel

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions