mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 21:52:45 +00:00 
			
		
		
		
	Kernel: Don't allocate memory for names of processes and threads
Instead, use the FixedCharBuffer class to ensure we always use a static buffer storage for these names. This ensures that if a Process or a Thread were created, there's a guarantee that setting a new name will never fail, as only copying of strings should be done to that static storage. The limits which are set are 32 characters for processes' names and 64 characters for thread names - this is because threads' names could be more verbose than processes' names.
This commit is contained in:
		
							parent
							
								
									0d30f558f4
								
							
						
					
					
						commit
						3fd4997fc2
					
				
					 22 changed files with 102 additions and 110 deletions
				
			
		|  | @ -350,10 +350,7 @@ void Plan9FS::ensure_thread() | |||
| { | ||||
|     SpinlockLocker lock(m_thread_lock); | ||||
|     if (!m_thread_running.exchange(true, AK::MemoryOrder::memory_order_acq_rel)) { | ||||
|         auto process_name = KString::try_create("Plan9FS"sv); | ||||
|         if (process_name.is_error()) | ||||
|             TODO(); | ||||
|         auto [_, thread] = Process::create_kernel_process(process_name.release_value(), [&]() { | ||||
|         auto [_, thread] = Process::create_kernel_process("Plan9FS"sv, [&]() { | ||||
|             thread_main(); | ||||
|             m_thread_running.store(false, AK::MemoryOrder::memory_order_release); | ||||
|             Process::current().sys$exit(0); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Liav A
						Liav A