Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Inline out_of_memory macro
Browse files Browse the repository at this point in the history
  • Loading branch information
thatguystone authored and xzyfer committed Mar 28, 2018
1 parent 1da6264 commit f315c93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/sass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ extern "C" {
void* ADDCALL sass_alloc_memory(size_t size)
{
void* ptr = malloc(size);
if (ptr == NULL)
out_of_memory();
if (ptr == NULL) {
std::cerr << "Out of memory.\n";
exit(EXIT_FAILURE);
}
return ptr;
}

Expand Down
5 changes: 0 additions & 5 deletions src/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@

namespace Sass {

#define out_of_memory() do { \
std::cerr << "Out of memory.\n"; \
exit(EXIT_FAILURE); \
} while (0)

double round(double val, size_t precision = 0);
double sass_strtod(const char* str);
const char* safe_str(const char *, const char* = "");
Expand Down

0 comments on commit f315c93

Please sign in to comment.