mirror of
				https://github.com/fedddddd/iw5-gsc-utils.git
				synced 2025-10-30 17:16:57 +00:00 
			
		
		
		
	Add addCommand function
This commit is contained in:
		| @@ -54,14 +54,14 @@ namespace utils | ||||
| 		return this->pool_.empty(); | ||||
| 	} | ||||
|  | ||||
| 	/*char* memory::allocator::duplicate_string(const std::string& string) | ||||
| 	char* memory::allocator::duplicate_string(const std::string& string) | ||||
| 	{ | ||||
| 		std::lock_guard _(this->mutex_); | ||||
|  | ||||
| 		const auto data = memory::duplicate_string(string); | ||||
| 		this->pool_.push_back(data); | ||||
| 		return data; | ||||
| 	}*/ | ||||
| 	} | ||||
|  | ||||
| 	void* memory::allocate(const size_t length) | ||||
| 	{ | ||||
| @@ -70,12 +70,12 @@ namespace utils | ||||
| 		return data; | ||||
| 	} | ||||
|  | ||||
| 	/*char* memory::duplicate_string(const std::string& string) | ||||
| 	char* memory::duplicate_string(const std::string& string) | ||||
| 	{ | ||||
| 		const auto new_string = allocate_array<char>(string.size() + 1); | ||||
| 		std::memcpy(new_string, string.data(), string.size()); | ||||
| 		return new_string; | ||||
| 	}*/ | ||||
| 	} | ||||
|  | ||||
| 	void memory::free(void* data) | ||||
| 	{ | ||||
|   | ||||
| @@ -34,7 +34,7 @@ namespace utils | ||||
|  | ||||
| 			bool empty() const; | ||||
|  | ||||
| 			//char* duplicate_string(const std::string& string); | ||||
| 			char* duplicate_string(const std::string& string); | ||||
|  | ||||
| 		private: | ||||
| 			std::mutex mutex_; | ||||
| @@ -55,7 +55,7 @@ namespace utils | ||||
| 			return static_cast<T*>(allocate(count * sizeof(T))); | ||||
| 		} | ||||
|  | ||||
| 		//static char* duplicate_string(const std::string& string); | ||||
| 		static char* duplicate_string(const std::string& string); | ||||
|  | ||||
| 		static void free(void* data); | ||||
| 		static void free(const void* data); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user