Skip to content

Commit

Permalink
fix: Fix returning arrays of primitives not being properly sized in J…
Browse files Browse the repository at this point in the history
…ava (#328)
  • Loading branch information
mrousavy authored Nov 12, 2024
1 parent 0074261 commit c027f54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions packages/nitrogen/src/syntax/kotlin/KotlinCxxBridgedType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -656,8 +656,7 @@ export class KotlinCxxBridgedType implements BridgedType<'kotlin', 'c++'> {
return `
[&]() {
size_t __size = ${parameterName}->size();
std::vector<${itemType}> __vector;
__vector.reserve(__size);
std::vector<${itemType}> __vector(__size);
${parameterName}->getRegion(0, __size, __vector.data());
return __vector;
}()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,7 @@ namespace margelo::nitro::image {
}());
return [&]() {
size_t __size = __result->size();
std::vector<double> __vector;
__vector.reserve(__size);
std::vector<double> __vector(__size);
__result->getRegion(0, __size, __vector.data());
return __vector;
}();
Expand Down

0 comments on commit c027f54

Please sign in to comment.