in lib/h3core.js [940:956]
export function gridDisk(h3Index, ringSize) {
const [lower, upper] = h3IndexToSplitLong(h3Index);
const countPtr = C._malloc(SZ_INT64);
try {
throwIfError(H3.maxGridDiskSize(ringSize, countPtr));
const count = validateArrayLength(readInt64AsDoubleFromPointer(countPtr));
const hexagons = C._calloc(count, SZ_H3INDEX);
try {
throwIfError(H3.gridDisk(lower, upper, ringSize, hexagons));
return readArrayOfH3Indexes(hexagons, count);
} finally {
C._free(hexagons);
}
} finally {
C._free(countPtr);
}
}