Skip to content

Conversation

@byrnedj
Copy link
Contributor

@byrnedj byrnedj commented Sep 12, 2025

DTO API

DTO provides drop-in replacements for standard memory operations. Each function
is available in three forms:

  • *_default uses library defaults.
  • *_cfg accepts a struct dto_call_cfg to override per-call behavior.
  • The unsuffixed name derives configuration from a bitwise OR of DTO_API_*
    flags.

Sample usage

/* Use defaults */
dto_memcpy_default(dst, src, sizeof(src));

/* Per-call configuration */
struct dto_call_cfg cfg = {
    .auto_adjust = 0,
    .cache_control = 1,
    .wait_method = WAIT_BUSYPOLL,
    .numa_mode = NA_BUFFER_CENTRIC,
    .overlapping_action = OVERLAPPING_CPU,
};
int diff = dto_memcmp_cfg(dst, src, sizeof(src), &cfg);

/* Flags-based configuration */
dto_memset(dst, 0, sizeof(dst), DTO_API_WAIT_YIELD);

-------

DTO provides drop-in replacements for standard memory operations. Each function
is available in three forms:

- *_default uses library defaults.
- *_cfg accepts a `struct dto_call_cfg` to override per-call behavior.
- The unsuffixed name derives configuration from a bitwise OR of `DTO_API_*`
  flags.

Sample usage
-------------

include <dto.h>

int main(void)
{
    char src[64] = "example";
    char dst[64];

    /* Use defaults */
    dto_memcpy_default(dst, src, sizeof(src));

    /* Per-call configuration */
    struct dto_call_cfg cfg = {
        .auto_adjust = 0,
        .cache_control = 1,
        .wait_method = WAIT_BUSYPOLL,
        .numa_mode = NA_BUFFER_CENTRIC,
        .overlapping_action = OVERLAPPING_CPU,
    };
    int diff = dto_memcmp_cfg(dst, src, sizeof(src), &cfg);

    /* Flags-based configuration */
    dto_memset(dst, 0, sizeof(dst), DTO_API_WAIT_YIELD);

    return diff;
}
@byrnedj byrnedj requested a review from jsydir September 12, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant