Merge commit '242ccfaef86ab3ab6a5f3c19f3396cdbc1049968'
This commit is contained in:
commit
3308262dfb
|
|
@ -94,7 +94,9 @@
|
||||||
setopt no_unset extended_glob pipe_fail prompt_percent typeset_silent \
|
setopt no_unset extended_glob pipe_fail prompt_percent typeset_silent \
|
||||||
no_prompt_subst no_prompt_bang pushd_silent warn_create_global
|
no_prompt_subst no_prompt_bang pushd_silent warn_create_global
|
||||||
|
|
||||||
if [[ $ZSH_VERSION != (5.<1->*|<6->.*) || $ZSH_VERSION == 5.4(|.*) ]]; then
|
autoload -Uz is-at-least
|
||||||
|
|
||||||
|
if ! is-at-least 5.1 || [[ $ZSH_VERSION == 5.4.* ]]; then
|
||||||
print -ru2 -- "[error] unsupported zsh version: $ZSH_VERSION"
|
print -ru2 -- "[error] unsupported zsh version: $ZSH_VERSION"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "check.h"
|
||||||
#include "string_view.h"
|
#include "string_view.h"
|
||||||
|
|
||||||
namespace gitstatus {
|
namespace gitstatus {
|
||||||
|
|
@ -94,6 +95,7 @@ class Arena {
|
||||||
template <class T>
|
template <class T>
|
||||||
inline T* Allocate(size_t n) {
|
inline T* Allocate(size_t n) {
|
||||||
static_assert(!std::is_reference<T>(), "");
|
static_assert(!std::is_reference<T>(), "");
|
||||||
|
CHECK(n <= SIZE_MAX / sizeof(T)) << n;
|
||||||
return static_cast<T*>(Allocate(n * sizeof(T), alignof(T)));
|
return static_cast<T*>(Allocate(n * sizeof(T), alignof(T)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue