Skip to content

Commit

Permalink
no throw
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Aug 13, 2024
1 parent 2f70c9a commit 0e88ae9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions node-script/wrap_symbols.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ void* __puerts_wrap__ZnamSt11align_val_t(unsigned long size, size_t alignment) {
#else
void* ptr = nullptr;
if (posix_memalign(&ptr, alignment, size) != 0) {
throw std::bad_alloc();
fprintf(stderr, "Fatal process out of memory for new");
abort();
}
return ptr;
#endif
Expand All @@ -147,7 +148,7 @@ void* __puerts_wrap__ZnamSt11align_val_tRKSt9nothrow_t(unsigned long size, size_
#else
void* ptr = nullptr;
if (posix_memalign(&ptr, alignment, size) != 0) {
throw std::bad_alloc();
return nullptr;
}
return ptr;
#endif
Expand All @@ -168,7 +169,8 @@ void* __puerts_wrap__ZnwmSt11align_val_t(unsigned long size, size_t alignment) {
#else
void* ptr = nullptr;
if (posix_memalign(&ptr, alignment, size) != 0) {
throw std::bad_alloc();
fprintf(stderr, "Fatal process out of memory for new");
abort();
}
return ptr;
#endif
Expand All @@ -189,7 +191,7 @@ void* __puerts_wrap__ZnwmSt11align_val_tRKSt9nothrow_t(unsigned long size, size_
#else
void* ptr = nullptr;
if (posix_memalign(&ptr, alignment, size) != 0) {
throw std::bad_alloc();
return nullptr;
}
return ptr;
#endif
Expand Down

0 comments on commit 0e88ae9

Please sign in to comment.