Skip to content

Commit 5e345c0

Browse files
committed
Some minor fixes
1 parent 8067c65 commit 5e345c0

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

src/ast.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ namespace Sass {
567567
bool empty() const { return elements_.empty(); }
568568

569569
bool has(K k) const {
570-
return elements_.count(k);
570+
return elements_.count(k) == 1;
571571
}
572572

573573
void reserve(size_t size)

src/file.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <cstdio>
1717
#include <vector>
1818
#include <algorithm>
19+
#include <unordered_map>
1920
#include <sys/stat.h>
2021
#include "file.hpp"
2122
#include "context.hpp"

src/memory_pool.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace Sass {
1111

1212
// Move this to somewhere else, should be global
13-
constexpr size_t SASS_MEM_ALIGN = sizeof(unsigned int);
13+
#define SASS_MEM_ALIGN sizeof(unsigned int)
1414

1515
inline static size_t align2(size_t n) {
1616
return (n + SASS_MEM_ALIGN - 1) & ~(SASS_MEM_ALIGN - 1);
@@ -54,25 +54,25 @@ namespace Sass {
5454

5555

5656
// The size of the memory pool arenas in bytes.
57-
constexpr static size_t SassAllocatorArenaSize = 1024 * 256;
57+
#define SassAllocatorArenaSize (1024 * 256)
5858

5959
// How many buckets should we have for the freelist
6060
// Determines when allocations go directly to malloc/free
6161
// For maximum size of managed items multiply by alignment
62-
constexpr static size_t SassAllocatorBuckets = 512;
62+
#define SassAllocatorBuckets 512
6363

6464
// The alignment for the memory fragments. Must be a multiple
6565
// of `SASS_MEM_ALIGN` and should not be too big (maybe 1 or 2)
66-
constexpr static size_t SassAllocatorAlignment = SASS_MEM_ALIGN * 2;
66+
#define SassAllocatorAlignment (SASS_MEM_ALIGN * 2)
6767

6868
// The number of bytes we use for our book-keeping before every
6969
// memory fragment. Needed to know to which bucket we belongs on
7070
// deallocations, or if it should go directly to the `free` call.
71-
constexpr size_t SassAllocatorBookSize = sizeof(unsigned int);
71+
#define SassAllocatorBookSize sizeof(unsigned int)
7272

7373
// Bytes reserve for book-keeping on the arenas
7474
// Currently unused and for later optimization
75-
constexpr size_t SassAllocatorArenaHeadSize = 0;
75+
#define SassAllocatorArenaHeadSize 0
7676

7777
class MemoryPool {
7878

src/ordered-map/ordered_hash.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ static T numeric_cast(U value, const char* error_message = "numeric_cast() faile
128128
* to represent a std::size_t on 32 and 64 bits platforms, and must be the same size on both platforms.
129129
*/
130130
using slz_size_type = std::uint64_t;
131-
static_assert(std::numeric_limits<slz_size_type>::max() >= std::numeric_limits<std::size_t>::max(),
132-
"slz_size_type must be >= std::size_t");
131+
// static_assert(std::numeric_limits<slz_size_type>::max() >= std::numeric_limits<std::size_t>::max(),
132+
// "slz_size_type must be >= std::size_t");
133133

134134
template<class T, class Deserializer>
135135
static T deserialize_value(Deserializer& deserializer) {

0 commit comments

Comments
 (0)