mirror of
				https://github.com/ml-explore/mlx.git
				synced 2025-11-04 10:38:10 +08:00 
			
		
		
		
	Do not store iostream in shared_ptr (#872)
There is no need to store iostream in shared_ptr, doing so adds the cost of a heap allocation.
This commit is contained in:
		@@ -121,7 +121,7 @@ class PyFileReader : public io::Reader {
 | 
			
		||||
    return out;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  size_t tell() const override {
 | 
			
		||||
  size_t tell() override {
 | 
			
		||||
    size_t out;
 | 
			
		||||
    {
 | 
			
		||||
      nb::gil_scoped_acquire gil;
 | 
			
		||||
@@ -334,7 +334,7 @@ class PyFileWriter : public io::Writer {
 | 
			
		||||
    return out;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  size_t tell() const override {
 | 
			
		||||
  size_t tell() override {
 | 
			
		||||
    size_t out;
 | 
			
		||||
    {
 | 
			
		||||
      nb::gil_scoped_acquire gil;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user