/* This file is part of limb https://lila.oss/limb
* Copyright (C) 2023 Olivier Brunel jjk@jjacky.com */
/* SPDX-License-Identifier: GPL-2.0-only */
#include <stdint.h> /* uintptr_t */
#include <limb/samisc.h>
void
sa_off2ptr(stralloc *sa, size_t arroff, size_t n)
{
uintptr_t *a = (uintptr_t *) (sa->s + arroff);
for (size_t i = 0; i < n; ++i) {
/* add the base, and turn this into a proper pointer */
*a += (uintptr_t) sa->s;
++a;
}
}