Files
Daco Harkes 6157f4598c [benchmark][ffi] Add simple callback benchmark
A basic benchmark for FFI callbacks. I'm currently not planning on
extending it to cover more calling conventions or running it on our
benchmark infra. We can leave that for when we want to do it.

Bug: https://github.com/dart-lang/sdk/issues/38171
Change-Id: I0c5fec81333e9a8da092b4f51ceb9f80a2eb2cf7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407020
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2025-02-04 03:36:29 -08:00

12 lines
381 B
C

// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include <stdint.h>
void CallFunction1Uint8(void (*callback)(uint8_t), uint32_t batch_size) {
for (uint32_t i = 0; i < batch_size; i++) {
callback(1);
}
}