<commit_before>#include "Buffer.h"
#include "Debug.h"
#include "Error.h"
#include "JITModule.h"
#include "runtime/HalideRuntime.h"
#include "Target.h"
#include "Var.h"
#include "IREquality.h"
#include "IROperator.h"

namespace Halide {
namespace Internal {

struct BufferContents {
    Image<> image;
    std::string name;
    mutable RefCount ref_count;
};

template<>
EXPORT RefCount &ref_count<BufferContents>(const BufferContents *p) {
    return p->ref_count;
}

template<>
EXPORT void destroy<BufferContents>(const BufferContents *p) {
    delete p;
}

namespace {
std::string make_buffer_name(const std::string &n, BufferPtr *b) {
    if (n.empty()) {
        return Internal::make_entity_name(b, "Halide::Internal::BufferPtr", 'b');
    } else {
        return n;
    }
}
}

BufferPtr::BufferPtr(const Image<> &buf, std::string name) :
    contents(new Internal::BufferContents {Image<>(buf), make_buffer_name(name, this)}) {}

BufferPtr::BufferPtr(Type t, const buffer_t &buf, std::string name) :
    contents(new Internal::BufferContents {Image<>(t, buf), make_buffer_name(name, this)}) {}

BufferPtr::BufferPtr(Type t, const std::vector<int> &size, std::string name) :
    contents(new Internal::BufferContents {Image<>(t, size), make_buffer_name(name, this)}) {}

bool BufferPtr::same_as(const BufferPtr &other) const {
    return contents.same_as(other.contents);
}

Image<> &BufferPtr::get() {
    return contents->image;
}<commit_msg>More windows fixes<commit_after>#include "Buffer.h"
#include "Debug.h"
#include "Error.h"
#include "JITModule.h"
#include "runtime/HalideRuntime.h"
#include "Target.h"
#include "Var.h"
#include "IREquality.h"
#include "IROperator.h"

namespace Halide {
namespace Internal {

struct BufferContents {
    Image<> image;
    std::string name;
    mutable RefCount ref_count;
};

template<>
EXPORT RefCount &ref_count<BufferContents>(const BufferContents *p) {
    return p->ref_count;
}

template<>
EXPORT void destroy<BufferContents>(const BufferContents *p) {
    delete p;
}

namespace {
std::string make_buffer_name(const std::string &n, BufferPtr *b) {
    if (n.empty()) {
        return Internal::make_entity_name(b, "Halide::Internal::BufferPtr", 'b');
    } else {
        return n;
    }
}
}

BufferPtr::BufferPtr(const Image<> &buf, std::string name) :
    contents(new Internal::BufferContents) {
    contents->image = Image<>(buf);
    contents->name = make_buffer_name(name, this);
}

BufferPtr::BufferPtr(Type t, const buffer_t &buf, std::string name) :
    contents(new Internal::BufferContents) {
    contents->image = Image<>(t, buf);
    contents->name = make_buffer_name(name, this);
}

BufferPtr::BufferPtr(Type t, const std::vector<int> &size, std::string name) :
    contents(new Internal::BufferContents) {
    contents->image = Image<>(t, size);
    contents->name = make_buffer_name(name, this);
}

bool BufferPtr::same_as(const BufferPtr &other) const {
    return contents.same_as(other.contents);
}

Image<> &BufferPtr::get() {
    return contents->image;
}
{'fraction_non_alphanumeric': 0.15138522427440634, 'fraction_numerical': 0.0, 'mean_word_length': 5.017857142857143, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4575366', 'n_tokens_mistral': 997, 'n_tokens_neox': 987, 'n_words': 228}