]> git.lizzy.rs Git - rust.git/commitdiff
reorganize comments for shim's classification
authorChristian Poveda <git@christianpoveda.xyz>
Wed, 19 Feb 2020 22:03:00 +0000 (17:03 -0500)
committerChristian Poveda <git@christianpoveda.xyz>
Wed, 19 Feb 2020 22:48:15 +0000 (17:48 -0500)
src/shims/foreign_items/posix.rs
src/shims/foreign_items/posix/linux.rs
src/shims/foreign_items/posix/macos.rs
src/shims/foreign_items/windows.rs

index f50b640e17cde064c1e3382c63770cf4d9d03baf..a4bc7e4726d0bf58430b802c0b72b9d1a51c1865 100644 (file)
@@ -104,6 +104,7 @@ fn emulate_foreign_item_by_name(
                 this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
             }
 
+            // Other shims
             "posix_memalign" => {
                 let ret = this.deref_operand(args[0])?;
                 let align = this.read_scalar(args[1])?.to_machine_usize(this)?;
index 27e42b0082e5a3e79573e4d7209ef5ab8d4a7b12..cf1431c8f11706ad3a2ecaa5adcc948501830a53 100644 (file)
@@ -40,6 +40,7 @@ fn emulate_foreign_item_by_name(
                 this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
             }
 
+            // Other shims
             "pthread_getattr_np" => {
                 this.write_null(dest)?;
             }
index 274248e8b54f7489f3bc14ccd4b69ff92a2a4f04..d0bb3109424dd35b65a622092eb87c9d15f6b9d3 100644 (file)
@@ -55,7 +55,7 @@ fn emulate_foreign_item_by_name(
                 this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
             }
 
-            // macOS API stubs.
+            // Other shims
             "pthread_attr_get_np" => {
                 this.write_null(dest)?;
             }
index 1eb84be0e3a0d7aacf0ce64ef548bb7f9ad18db4..29eac99e565cdbc3470eccae8c8b71d4317cb06c 100644 (file)
@@ -16,6 +16,11 @@ fn emulate_foreign_item_by_name(
         let tcx = &{ this.tcx.tcx };
 
         match link_name {
+            // Windows API stubs.
+            // HANDLE = isize
+            // DWORD = ULONG = u32
+            // BOOL = i32
+
             // Environment related shims
             "GetEnvironmentVariableW" => {
                 // args[0] : LPCWSTR lpName (32-bit ptr to a const string of 16-bit Unicode chars)
@@ -70,10 +75,8 @@ fn emulate_foreign_item_by_name(
                     dest,
                 )?;
             }
-            // Windows API stubs.
-            // HANDLE = isize
-            // DWORD = ULONG = u32
-            // BOOL = i32
+
+            // Other shims
             "GetProcessHeap" => {
                 // Just fake a HANDLE
                 this.write_scalar(Scalar::from_int(1, this.pointer_size()), dest)?;