<commit_before>#include "builtin/nativemethod.hpp"
#include "objectmemory.hpp"
#include "gc/baker.hpp"
#include "capi/capi.hpp"
#include "capi/handles.hpp"

namespace rubinius {
  namespace capi {

    Handle* Handles::allocate(STATE, Object* obj) {
      bool needs_gc = false;
      Handle* handle = allocator_->allocate(&needs_gc);
      handle->set_object(obj);
      handle->validate();
      if(needs_gc) {
        state->memory()->collect_mature_now = true;
      }
      atomic::memory_barrier();
      return handle;
    }

    uintptr_t Handles::allocate_index(STATE, Object* obj) {
      bool needs_gc = false;
      uintptr_t handle_index = allocator_->allocate_index(&needs_gc);
      Handle* handle = allocator_->from_index(handle_index);
      handle->set_object(obj);
      handle->validate();
      if(needs_gc) {
        state->memory()->collect_mature_now = true;
      }
      atomic::memory_barrier();
      return handle_index;
    }

    Handle* Handles::find_index(STATE, uintptr_t index) {
      Handle* handle = allocator_->from_index(index);

      assert(validate(handle));

      return handle;
    }

    bool Handles::validate(Handle* handle) {
      return allocator_->validate(handle);
    }

    Handles::~Handles() {
      for(std::vector<int>::size_type i = 0; i < allocator_->chunks_.size(); ++i) {
        Handle* chunk = allocator_->chunks_[i];

        for(size_t j = 0; j < allocator_->cChunkSize; j++) {
          Handle* handle = &chunk[j];
          if(handle->in_use_p()) {
            handle->clear();
          }
        }
      }<commit_msg>Removed debugging assert for Handles::find_index.<commit_after>#include "builtin/nativemethod.hpp"
#include "objectmemory.hpp"
#include "gc/baker.hpp"
#include "capi/capi.hpp"
#include "capi/handles.hpp"

namespace rubinius {
  namespace capi {

    Handle* Handles::allocate(STATE, Object* obj) {
      bool needs_gc = false;
      Handle* handle = allocator_->allocate(&needs_gc);
      handle->set_object(obj);
      handle->validate();
      if(needs_gc) {
        state->memory()->collect_mature_now = true;
      }
      atomic::memory_barrier();
      return handle;
    }

    uintptr_t Handles::allocate_index(STATE, Object* obj) {
      bool needs_gc = false;
      uintptr_t handle_index = allocator_->allocate_index(&needs_gc);
      Handle* handle = allocator_->from_index(handle_index);
      handle->set_object(obj);
      handle->validate();
      if(needs_gc) {
        state->memory()->collect_mature_now = true;
      }
      atomic::memory_barrier();
      return handle_index;
    }

    Handle* Handles::find_index(STATE, uintptr_t index) {
      return allocator_->from_index(index);
    }

    bool Handles::validate(Handle* handle) {
      return allocator_->validate(handle);
    }

    Handles::~Handles() {
      for(std::vector<int>::size_type i = 0; i < allocator_->chunks_.size(); ++i) {
        Handle* chunk = allocator_->chunks_[i];

        for(size_t j = 0; j < allocator_->cChunkSize; j++) {
          Handle* handle = &chunk[j];
          if(handle->in_use_p()) {
            handle->clear();
          }
        }
      }
{'fraction_non_alphanumeric': 0.1419498253413782, 'fraction_numerical': 0.0012702445220704986, 'mean_word_length': 2.827460510328068, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 41, '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': '2599708', 'n_tokens_mistral': 1024, 'n_tokens_neox': 989, 'n_words': 178}