Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CTL - setting global namespace #1058

Open
KFilipek opened this issue Jan 24, 2025 · 3 comments
Open

CTL - setting global namespace #1058

KFilipek opened this issue Jan 24, 2025 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@KFilipek
Copy link
Contributor

KFilipek commented Jan 24, 2025

CTL - setting global namespace

Rationale

Intention of this issue is to discuss and summarize the implementation for default part of the CTL.
This issue is a part of: #1036

Description

The CTL for global namespace is the way to set default values for pool, providers etc.

API Changes

API to be added:

umf_result_t umfCtlSet(const char *name, ...);
umf_result_t umfCtlGet(const char *name, ...);
umf_result_t umfCtlExec(const char *name, ...);

Examples of use

umfCtlSet("umf.pool.default.disjoint.SlabMinSize", &value);

Implementation details

The implementation should be split into 2 parts, first is the main CTL tree:

umf
├── pool
|   └── default
|       └── SUB_TREE (aka NAME)
└── provider
    └── default
        └── SUB_TREE (aka NAME)

After encountering SUB_TREE there should be located a proper CTL tree, appropriate for the mentioned type:

disjoint sub-tree
├── SlabMinSize (size_t)
├── MaxPoolableSize (size_t)
├── Capacity (size_t)
├── MinBucketSize (size_t)
├── CurPoolSize (size_t)
├── PoolTrace (int)
└── Name (char *)

Meta

@KFilipek KFilipek added the enhancement New feature or request label Jan 24, 2025
@KFilipek KFilipek self-assigned this Jan 24, 2025
@bratpiorka
Copy link
Contributor

"example of use" should be UmfCtlSet("umf.pool.disjoint.default.SlabMinSize", &value); ?

@PatKamin
Copy link
Contributor

Perhaps the default part could be dropped, leaving this part only for additional by_ptr subtree.

@bratpiorka
Copy link
Contributor

Perhaps the default part could be dropped, leaving this part only for additional by_ptr subtree.

I would like this API to be as explicit and clear as possible - imo if a parser sees "default" then this explicitly means that a further part should be used to set/get default props, without any extra "ifs". Also in UMF, we use "handles" not pointers. So we end up with:

umf.pool.disjoint.default.SlabMinSize
umf.pool.disjoint.by_handle.%p.SlabMinSize
umf.pool.disjoint.by_name.%s.SlabMinSize // or by_id or similar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants